Home » Questions » Computers [ Ask a new question ]

How do I restore .bat files association with the system (make them run when double-clicked)?

How do I restore .bat files association with the system (make them run when double-clicked)?

What do I set the 'Opens with...' property to in order to get the system to run .bat files again (when they are double-clicked)?

Asked by: Guest | Views: 179
Total answers/comments: 5
bert [Entry]

"I think you'll have to remove the .bat file association from the registry (using the regedit program).

According to this forum thread on LockerGnome, you need to remove registry settings underneath this key:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.bat

You'll probably want to back up registry before doing this, just to be safe."
bert [Entry]

"None of the answers above fixed it for the machine I was working with, but what fixed it was starting an Admin Shell and running

assoc .bat=batfile
assoc .cmd=batfile"
bert [Entry]

"The answer that got 40 votes by Kaleb didn't work for me but I ended up finding the answer. To get the bat file to execute again, you have to go to:

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes.bat] and set (Default) to ""batfile"". If you have batch scripts opening in Word or Notepad++ instead of running on double click, it's because those programs have set (Default) to their own mimes.

If you want a quick fix, just open a text file and paste:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.bat]
@=""batfile""

And save it with a .reg extension and double click to merge."
"The answer that got 40 votes by Kaleb didn't work for me but I ended up finding the answer. To get the bat file to execute again, you have to go to:

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes.bat] and set (Default) to ""batfile"". If you have batch scripts opening in Word or Notepad++ instead of running on double click, it's because those programs have set (Default) to their own mimes.

If you want a quick fix, just open a text file and paste:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.bat]
@=""batfile""

And save it with a .reg extension and double click to merge."
bert [Entry]

"In the regisrty you .bat entry needs to point to the batfile entry:

[HKEY_CLASSES_ROOT\.bat]
@=""batfile""
.....

Naturally you will also need to make sure you have a batfile registry entry:

[HKEY_CLASSES_ROOT\batfile]
@=""MS-DOS Batch File""
....."
bert [Entry]

"In Windows 8 use Notepad to make or modify a Batch file but the secret is the following:

Save the batch file using double quotes.
Literally use ""MYBACK.BAT"" using the double quotes in the save box to save the file.
Instead of MYBACK.BAT"