2

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 1

2

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 under HKEY_CLASSES_ROOT\.bat. It should say batfile.
    • If it does goto HKEY_CLASSES_ROOT\batfile\shell\open\command. It should say "%1" %*

  • 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 under HKEY_CLASSES_ROOT\.bat. It should say batfile.
    • If it does goto HKEY_CLASSES_ROOT\batfile\shell\open\command. It should say "%1" %*
8
  • 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.
    – Pablo678
    Oct 4, 2013 at 20:00
  • Yeah, I'm getting my Windows-versions mixed up. What does the Default say in your key HKEY_CLASSES_ROOT\.bat ?? It should say batfile.
    – Rik
    Oct 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}"
    – Pablo678
    Oct 4, 2013 at 20:43
  • I edited my answer. What does HKEY_CLASSES_ROOT\batfile\shell\open\command say?
    – Rik
    Oct 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.
    – Pablo678
    Oct 4, 2013 at 21:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .