How to fix Windows Batch file association on Server 2008

How to fix Windows Batch file association on Server 2008.

Somehow my .bat file association got set to “Windows Batch File” instead of “Unknown Application”. This resulted in the batch file opening a command prompt window upon double-clicking the icon. Running the batch file from the command line worked fine, just the double-click action was going sideways.
After looking into multiple (3+ days) searches on the Interwebs with no success, I came across one tidbit of information from a Lockergnome forum.–ftopict514456.html

Also look for the key;
and delete the key named

Following the thread and seeing that all my assoc and ftype commands were correct, Dave Patrick references a single registry entry that lead me to the answer. According to the thread, users deleting this key said it works for them. This may still be true, but they were working on XP and Vista.

Being that this was Windows Server 2008R2, I didn’t want to take a scorched earth policy to this problem, potentially cause more problems and ultimately not know if a simpler fix would suffice. So I decided to investigate that key further. By comparing that registry key from a working Server 2008 install against the non-working Server 2008 install, I figured out what minor changes make the batch file process the double-click action properly.

Correct Server entries
Registry location on Server 2008

Correct OpenWithList key

Correct OpenWithProgids

Wrong Server follows:
Wrong OpenWithList

Wrong OpenWithProgids

Extra UserChoice key

The extra UserChoice key with Progid: Applications\cmd.exe that was overriding the default handling of batch file execution upon double-click actions.

Solution to my issue was to delete the two extra items in OpenWithList (a and MRUList), and delete the entire UserChoice key from under the .bat key. Removing the UserChoice key would most likely correct the issue at hand, but just to ensure completeness, I removed the extra references in the OpenWithList key.

Note: The icon displayed in Windows Explorer looked like the C:\ prompt. Another clue that it wasn’t right. The correct icon should look like two gears, one larger than the other. After deletion of the above keys, the default icon was also reset to the two gears.


This entry was posted in Server and tagged , , , , , , , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>