3

I have .java files that right now open with a default program that is notepad++, but I don't want a default program to open all my Java files, I want to choose every time.

How would I go about making it not have a default opening program?

Kevin Panko
  • 7,466

1 Answers1

0

Standard Windows tools allow you to change the default program, but not remove it. If you could remove the default (by registry editing), you would be offered a list of recommended and other programs. If you select one and don't clear the "Always use this" flag, you'll get your default back and you'll need to start again (and I know how easy that is to do).

A simple alternative would be to press the Browse button and find a previously created program or script to show a message to tell you to right-click and use "Open With".

If you have no programming tools, create a script, such as NoDefault.cmd, containing:-

@echo off
echo Right-click and use Open With
pause

It won't be as pretty as a message box, but it will do the job, and after double-clicking a few times you will soon get used to right-clicking. The disadvantage is that NoDefault.cmd (or whatever else you use to display the message box) will now appear in your "Open With" list, but I cannot see an easy way round that: any default program is bound to be listed. It will require registry editing to get rid of it from this list after removing as the default.

A more elaborate solution would be to create a default program or script to allow you to select from a list, and launch directly from the selected list item, but that seems like over-kill.

Having said all that, I have this problem myself on certain file types, and I have done none of the above, but simply got used to right-clicking on the extensions where I require a choice of actions at different times, making sure that the default does not do anything potentially harmful. Your default of opening notepad++ is a lot safer than running the script, even if you find it annoying, but the more annoying, the quicker you'll learn!

If you still want to try changing the default, I suggest you create a new extension to experiment with, so that you know what will work best for you before you start changing the Java extensions. XP explorer has a "File Types" tab under Tools -> Folder Options, which gives you a lot of control over the right-click menu, including setting the default action. It is probably harder to find on later Windows (most such things are).

AFH
  • 17,958