I think Winrar is a great archive manager but sometimes it doesn’t do exactly what you want.
For example, how would you go about extracting an archive with Winrar?
Let’s say you just downloaded the super cool Python web framework called Django to your Downloads folder. Your freshly snagged file is called Django-1.6.tar
Most people would just browse to the archive, right-click it and choose Extract To Django-1-6\ from the context menu. This will dump the contents of the archive to a folder in the current directory; however, that’s too many steps… and man I’m lazy.
Is there a faster way to accomplish the same task?
Wouldn’t it be nice if you could instantly extract the archive to a folder with the same name by simply double-clicking the archive?
Yes, I’m glad you asked. Fortunately we can do some digital alchemy with the registry to conjure up a nice little hack. It’s actually pretty easy to pull off, let me walk you through the process…
Backup the Registry
First we need to pop open the registry and export a copy as a backup. That way if we fat-finger a mistake we can import the registry and get out of our conundrum.
Click Start and type:
and click File > Export.
Save it to a USB stick or external drive and call it registry-before-winrar-hack.
Depending on the size of your registry this could take anywhere from a few seconds to 5 minutes. When it finishes you’ll see the file hanging out on your file system. Mine was about 150MB and took 5 seconds to complete.
Keys and Values
Now go back to the registry. Do you see all those folders in the left pane? Those are called keys and share virtually the same function as traditional folders. The nested keys are called sub-keys.
Also, like Windows folders Registry keys are hierarchical. We need to expand the keys to access the default values for the WinRar command. That way we can get in there and change what happens when you double click WinRar files.
Modify the command Key
Drill down to the following key:
You can confirm you’re in the right place by looking at the full path in the status bar that rides along the bottom edge of the Registry window.
Notice the (Default) name in the right pane.
Right click that, choose Modify and you’ll see an existing value in there. It probably says something such as:
"C:\Program Files\WinRar\WinRar.exe" "%1"
You want to change it so there’s a padded x between the two ditto marks that separate the …exe” part from the “%1” part.
Change it so it looks like this:
"C:\Program Files\WinRAR\WinRAR.exe" x "%1"
Click OK, close the registry and you’re done. Double clicking the compressed file should auto-extract it to a new folder of the same name as the compressed file.
Most of that time that works; however, if it still not working for you then we can create a small batch file that will kick off on a double click event. I know this sounds like a byzantine plan but it’s really pretty straightforward.
Fun with BAT files
Check it out:
Bust open Notepad and copy and paste the following line into the file.
"C:\Program Files\WinRAR\WinRAR.exe" x %1 "%~n1\"
Make sure you save it with a .BAT extension (not with the default .txt file extension). I’ll save mine as Winrar-auto-extract.bat.
Note the location where you saved the file because you’ll need that info for the registry hack.
Once you’ve saved the file, flip over to the Registry again and replace the Default value in HKEY_CLASSES_ROOT\WinRAR\shell\open\command with the path to your .BAT file.
Click OK and that will do the trick.