Windows 7: Endless explorer.exe chain on file type association

Today I attempted to make .jar archives open as compressed folders by default instead of being run in Java on opening. My first guess on how to do this was by associating it with C:/Windows/explorer.exe, and I did this by r-clicking on a .jar file, selecting Open with > Choose default program... then navigating to the explorer.exe directory, and checked the 'Always use the selected program to open this kind of file' box.

This is where it goes horribly wrong. Apparently Windows Explorer can't tell itself to open a file with itself. When I try to open a .jar file that is set to open with Windows Explorer, an endless loop of explorer.exe processes (thousands) start up one after another, until I run out of memory. To get rid of them, I have to restart.

Afterwards, the box 'Always use the selected program to open this kind of file' is greyed out, so I can't restore the association to its original. Using the command 'assoc .jar=CompressedFile' is also useless.

How do I restore the original association to the .jar file extension? Also, to solve my initial problem, how can I make Windows open .jar files as compressed folders instead of using Java.exe?
 

Question Info


Last updated March 8, 2019 Views 4,311 Applies to:
Answer
Answer
I know that the default handler for ZIP is not an executable directly, but it should be possible to associate with other types just the same.  Filetype associations have two parts: a file kind that describes the file, like "Adobe Reader File".  Then that is paired with the type handler that actually links to the associated actions for opening that kind.

To get jar files to open with the same handler as ZIP, only one side of that pair needs to be edited in the registry, the .jar extension.  But I really wouldn't recommend doing it manually because of the risks of issues from editing the registry.  Set yourself a restore point or backup the registry, then try these steps - at your own risk/peril :)

  • Look in HKEY_CLASSES_ROOT\.zip and see the structure.  Note that it says .zip = CompressedFolder.

  • Knowing that, look at HKEY_CLASSES_ROOT\CompressedFolder.  Here you see the actual command used to open these files (as well as the "friendly display name" that is used to describe these files when you mouse over them and such).

  • To get JAR files to act the same, you only need to edit the .jar entry and set the default to CompressedFolder type.  That tells it to use the same settings as CompressedFolder.
Shawn "Cmdr" Keene | Microsoft MVP - Windows Insider | CmdrKeene.com | tweet me: @LtCmdrKeene
Microsoft MVPs are independent experts offering real-world answers. Learn more at mvp.microsoft.com.

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.