For some reason or other my .bat files are associated with notepad and will therefore not run. Looking for answers, I have only found solutions for systems other that XP. Assistance would be greatly appreciated.
1 Answer
You need to do the following:
- Start
regedit.exe
- Make a backup of the registry.
- For Windows 7 you should check the following:
- delete the
UserChoice
under the following key:HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.bat
- Check the
Default
underHKEY_CLASSES_ROOT\.bat
. It should saybatfile
. - If it does goto
HKEY_CLASSES_ROOT\batfile\shell\open\command
. It should say"%1" %*
- delete the
- For Windows XP you should check the following:
- delete the whole key
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.bat
- Check the
Default
underHKEY_CLASSES_ROOT\.bat
. It should saybatfile
. - If it does goto
HKEY_CLASSES_ROOT\batfile\shell\open\command
. It should say"%1" %*
- delete the whole key
-
Thanks for replying Rik. I didn't have the key you mentioned so I didn't have to delete it. The other key got inserted correctly but .bat files still get opened in notepad. What does "batfile"=hex(0): do? I couldn't see what trace it left.– Pablo678Oct 4, 2013 at 20:00
-
Yeah, I'm getting my Windows-versions mixed up. What does the
Default
say in your keyHKEY_CLASSES_ROOT\.bat
?? It should saybatfile
.– RikOct 4, 2013 at 20:25 -
Yes,it does say batfile and it has a subkey [HKEY_CLASSES_ROOT\.bat\PersistentHandler] @="{5e941d80-bf96-11cd-b579-08002b30bfeb}"– Pablo678Oct 4, 2013 at 20:43
-
I edited my answer. What does
HKEY_CLASSES_ROOT\batfile\shell\open\command
say?– RikOct 4, 2013 at 20:53 -
HKEY_CLASSES_ROOT\batfile\shell\open\command does not exist on my machine. It stops at HKEY_CLASSES_ROOT\batfile\shell with subkeys edit and print.– Pablo678Oct 4, 2013 at 21:11