The Final Reg File the user had to use to correct this issue in Windows 8.1 [after running the batch file provided by Notepad++ to set notepad++ as default batch file handler. They tried both of the other fixes below this one. In the end they had to run the following in a .reg file as admin.
FIRST, to run a reg file as admin:
Note: It is best to place this file on C:\ and name file something like fix.reg so in the end it is something like C:\fix.reg. If you place this somewhere where the path and/or file name has any spaces included in it you will get an error message and the reg keys will not be added/changed.
runas /user:Administrator "regedit.exe c:\fix.reg"
The contents of the fix.reg file:
Windows Registry Editor Version 5.00
@="Windows Batch File"
[HKEY_CLASSES_ROOT\batfile\ShellEx\PropertySheetHandlers\ShimLayer Property Page]
Other Possible fixes to try if above does not work for you [It has been verified to work by at least 1 person where the below did not in Windows 8.1]
Registry key to navigate to: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts.BAT\UserChoice
Delete the key named "user choice"
Code Block for clarity (per request):
Also listed on the reference page as a fix is the following:
I would disagree there. This is not a Windows 8 specific issue.
Something has changed the file association, and it needs to be changed
back. This same issue can be replicated all the way back to Windows
2000 (and probably earlier). Did you check the following keys and make
sure they were set to the values shown, as seen in the responses in
[HKEY_CLASSES_ROOT\batfile\shell\open\command] @="\"%1\" %*"
The user of this second more complex solution also has a link to a *.reg file they created which should automagically set those several keys listed above this text for you to the default values. See Bottom of reference page as this was marked as Best Solution and those are kept at bottom of page (why M$ made that decision is beyond me would you not put solutions at top of threads so they are easier to find? Good ol M$)
That should do it and have notepad++ stop taking over. As a side note you can right click a *.bat file and if you click the Edit entry in the menu that will open the batch file in notepad for you while still leaving the double click to execute the batch file in a command shell.
Reference used [Listed in the Windows 7 forum but is the same in Windows 8.1 btw]:
More detailed Info (how to open regedit and run as admin if needed)
For this one it is a little tricky since we have to use the Registry Editor. You SHOULD be able to do this as a user since the change is a user level one most of the time, but depending on your security policies in place you may have to do the following.
- Click the Start Menu Button
- Type in regedit (just start typing when the start menu is visible and it should start searching automatically).
- Once you see regedit appear on screen right click on it
- When you see the context menu appear click on Run as Administrator
- Authenticate (type in your administrator password, place finger on fingerprint reader however you have it setup it's like logging in to the account)
Side Note: You can try it first without doing the administrator part if you would like. The worst thing that it will do is deny your ability to delete the key listed. If this happens you must run as administrator and you will then be able to delete it.
Generally for MOST file associations in almost all versions of Windows (aside from system set ones such as batch files):
All you should have to do is hold the LEFT Shift Key down while you right click on a *.bat file. When you do this to a file you should see an Open With ... option appear close to the top of the context menu that appears [the small menu that you get when you right click on things]. Once you click open with you will get a dialog where you can choose what to open the file with. If you check the Use as default box in lower left corner it will become the new default action when you double click files of the same type.