Making WinRAR extract archives by default when double clicking RAR files?

Solution 1:

  1. Open regedit

  2. Go to HKEY_CLASSES_ROOT\WinRAR\shell\open\command

  3. Change the (Default) value from "C:\Program Files\WinRAR\WinRAR.exe" "%1"
    to "C:\Program Files\WinRAR\WinRAR.exe" x "%1"

  4. If you have ZIP files associated with WinRAR too, change the corresponding value under
    HKEY_CLASSES_ROOT\WinRAR.ZIP\shell\open\command too.

(Obviously for 32-bit WinRAR the path will be different.)

This however will probably not create a sub-directory named after the archive in the current directory while extracting. (At least it doesn't for me given my WinRAR settings.) For that you'll have to change the (Default) value(s) mentioned above to something like "C:\Extract.bat" "%1", then create the batch file with the following content (just a single line):

"C:\Program Files\WinRAR\WinRAR.exe" x %1 "%~n1\"

This should do what you want, and as a bonus you can now right-click and "Open" multiple archives (or select them and press Enter) and they will all be automatically extracted to individual sub-directories by the batch file.

Note: The Extract to <archive name\> context menu entry is generated dynamically by the shell extension based on the archive's name, so no key by that name exists in the registry. For a static key it would be simple to just set it as the default action instead of Open, but this is not possible here due to the dynamic nature of the option.