7-zip & Windows 7: Make “Extract to ” default on double-click












14















I'm trying to find a way to make the action you can perform from the context menu, "Extract to <folder_same_as_file_name>" the default action when double-clicking the file instead of simply launching 7-zip. Is there a simple way to do this?



In the alternative, I gather I could try passing parameters into the following:



7z x <filename> -o<filename>



But I'm not sure how to set this up (how to pass the filename parameter, and can I do this directly or will I have to write a batch file instead and pass the filename to it? The latter I find irritatingly unelegant, but whatever works.










share|improve this question





























    14















    I'm trying to find a way to make the action you can perform from the context menu, "Extract to <folder_same_as_file_name>" the default action when double-clicking the file instead of simply launching 7-zip. Is there a simple way to do this?



    In the alternative, I gather I could try passing parameters into the following:



    7z x <filename> -o<filename>



    But I'm not sure how to set this up (how to pass the filename parameter, and can I do this directly or will I have to write a batch file instead and pass the filename to it? The latter I find irritatingly unelegant, but whatever works.










    share|improve this question



























      14












      14








      14


      6






      I'm trying to find a way to make the action you can perform from the context menu, "Extract to <folder_same_as_file_name>" the default action when double-clicking the file instead of simply launching 7-zip. Is there a simple way to do this?



      In the alternative, I gather I could try passing parameters into the following:



      7z x <filename> -o<filename>



      But I'm not sure how to set this up (how to pass the filename parameter, and can I do this directly or will I have to write a batch file instead and pass the filename to it? The latter I find irritatingly unelegant, but whatever works.










      share|improve this question
















      I'm trying to find a way to make the action you can perform from the context menu, "Extract to <folder_same_as_file_name>" the default action when double-clicking the file instead of simply launching 7-zip. Is there a simple way to do this?



      In the alternative, I gather I could try passing parameters into the following:



      7z x <filename> -o<filename>



      But I'm not sure how to set this up (how to pass the filename parameter, and can I do this directly or will I have to write a batch file instead and pass the filename to it? The latter I find irritatingly unelegant, but whatever works.







      windows-7 7-zip






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 18 '11 at 21:20









      studiohack

      11.3k1880114




      11.3k1880114










      asked Mar 18 '11 at 20:15









      schodgeschodge

      2281410




      2281410






















          6 Answers
          6






          active

          oldest

          votes


















          4














          Unfortunately, afrazier's batch program method won't work; Windows doesn't handle opening multiple files like that. When you try to open multiple files with a program, Windows doesn't open a single instance of the program and pass the files as multiple arguments to that one instance. Instead, Windows opens many instances of the program (as many instances as there are files), passing one file to each instance. It would be nice if you could just use %* and pass a bunch of files to a single .bat, and have that .bat run a loop processing each file one at a time, but unfortunately you can only use %1 when setting these kinds of actions in the registry.



          Someone with some time on their hands could write a program that uses a mutex object to check if there is another instance already running, and if there is, to pass it's file to that instance and then close, whereon the original instance will put that file in a queue and get to it once it's done processing its own file. a batch could do the trick using tasklist and find, too, but that's not as good of a solution as mutex.



          Anyway, try this for your extract command registry value to get the right folder name:



          "pathto7z.exe" x "%1" -o* -aou


          This will create a new folder in the same directory as the source archive with the same name as the source archive (sans the file extension).



          Also, I added the -aou switch to automatically avoid filename conflicts (7z will append a number to the end of a file instead prompting you whether you want to overwrite or whatever).






          share|improve this answer


























          • Is there a way to do as -o* does, but only if there's more than one file in the archive? As in, can I make it extract to the current directory if there's only one file or folder in the archive?

            – NightExcessive
            Jun 26 '16 at 0:18











          • Default in Windows 10 is "C:Program Files7-Zip7zFM.exe" x "%1" -o* -aou so change the 7zFM to just 7z "C:Program Files7-Zip7z.exe" x "%1" -o* -aou

            – jsherk
            Dec 2 '17 at 17:36



















          11














          This thread has become a bit confusing because of contradicting answers (it took me quite some time to figure out which was the right solution) so I thought it might be a good idea to summarize the results from afrazier's and Justin Roettger's posts combinded with my own experiences:




          1. Start regedit as administrator

          2. Open HKEY_CLASSES_ROOT7-Zip.7z

          3. Under that key, expand the Shell sub-key

          4. Set the (Default) value to the string extract

          5. Create a new sub-key named extract

          6. Set the (Default) value for the extract key to Extract to
            Folder


          7. Create a new sub-key under extract named command

          8. Set the (Default) value of the command key to:



          C:Program Files7-Zip7zG.exe x "%1" -o*




          (you might have to adjust this to match the path of your 7-Zip installation)



          Instead of 7z with -aou like Justin Roettger suggested I ended up using 7zG, because this way you can choose to overwrite if you like just like extracting with the normal context menu.



          That's it! 7z files are now extracted to a folder with their own name by double click. For other extensions like .rar and .zip you need to repeat these steps for the according keys.
          (i.e. HKEY_CLASSES_ROOT7-Zip.rar and HKEY_CLASSES_ROOT7-Zip.zip and so on)



          Oh and to clarify: It does work with multiple files selected as well. No batch file need.






          share|improve this answer





















          • 1





            I don't see that registry path. I'm on Windows 8 w/ 64-bit 7zip.

            – phillipwei
            Jun 18 '14 at 18:40











          • Lots has changed since this post, but it still works great ... for me, it was under 7z_auto_file, not 7-Zip.7z. All I did was change the existing "command" to C:Program Files7-Zip7zG.exe x "%1" -o* and voila.

            – neokio
            Dec 21 '15 at 7:35











          • On Windows 10, I also didn't see the path until I associated at least one file with 7-Zip in the 7-Zip File Manager (via Tools -> Options... menu).

            – Chris Nolet
            May 4 '17 at 20:50



















          5














          The easy way



          Install ExtractNow. You can configure it to do exactly what you want.





          The hard way



          Manual registry modification as follows...




          • Start regedit as administrator


          • Open HKCR.7z and look at the (Default) value. Take note of what that is (in my case, as a PowerArchiver user, it's PASZIP)


          • Go to the registry key in HKCR named that. (in my case HKCRPASZIP)


          • Under that key, expand the Shell sub-key


          • Set the (Default) value to the string extract


          • Create a new sub-key named extract


          • Set the (Default) value for the extract key to Extract to Folder


          • Create a new sub-key under extract named command



          • Set the (Default) value of the command key to



            C:Program Files7-Zip7zG.exe x "%1" -o* -aou


            (you might have to adjust the path)




          Thanks to Justin Roettger for pointing out the correct name variable needed for this.



          That should be it. Now 7z files are extracted to a folder with their own name by double click. For other extensions like .rar and .zip you need to repeat this steps for the according keys.



          If you only want to make the changes on your user account instead of system-wide, modify HKCUSoftwareClasses instead of HKCR. HKCR is a virtual key that's a union of HKLMSoftwareClasses and HKCUSoftwareClasses where the data in your account (HKCU) overrides the system-wide data (HKLM). Normally running regedit as an Administrator means that modifying HKCR alters system-wide data in HKLM.





          Extracting multiple files



          Of course, this won't work if you have multiple files selected. If you want that to work, you need to create the following batch file:



          @echo off
          :top
          if "%1"=="" goto :EOF
          7z.exe x "%1" -o"%~dpn1"
          shift
          goto top


          Now, follow the instructions above. In the very last step, set the (Default) value of the command key to C:PathToFile.bat %*



          All of the registry modifications are untested from memory, but should be correct.






          share|improve this answer


























          • Does %~dpn1 work in file associations? (It doesn't in Windows XP. Also, you forgot x for extension.)

            – grawity
            Mar 18 '11 at 20:46






          • 1





            @grawity: You don't want the x in the output folder name. As for it working... That's a good question. I'll edit to address...

            – afrazier
            Mar 18 '11 at 20:48











          • Hm, good point.

            – grawity
            Mar 18 '11 at 21:12











          • So close, but not quite there yet. After playing with the code both afrazier and grawity provided, I have the default key value set as "C:Program Files7-Zip7z.exe" x "%1" -o"%~dpn1" I wasn't getting any benefit from running cmd.exe that I could tell, and 7-zip's default open didn't bother with it. However, this is just unzipping to %~dpn1 in the same folder as the zip file. The "%1.d" gives a filename.zip.d subdirectory in the same folder as the zip file, so it's closer, but not stripping off the extension. I've tried hybrids of the two, no luck. Any other suggestions?

            – schodge
            Mar 25 '11 at 1:43













          • You'll probably have to use a batch file.

            – afrazier
            Mar 25 '11 at 3:51



















          2














          Here's PowerShell script I wrote based on @haiggoh's answer. Before you run it, you need to open 7-zip, go to Tools->Options and associate 7-zip with wanted file extensions. After that, run the following PowerShell script (with admin rights):



          $7zInstallationFolder = 'C:Program Files7-Zip'
          $reg = [Microsoft.Win32.RegistryKey]::OpenBaseKey([Microsoft.Win32.RegistryHive]::ClassesRoot, [Microsoft.Win32.RegistryView]::Default)
          $subKeys = $reg.GetSubKeyNames() | where { $_ -match '7-Zip.' }
          foreach ($keyName in $subKeys) {
          $key = $reg.OpenSubKey($keyName + 'shellopencommand', $true)
          $key.SetValue('', '"' + $7zInstallationFolder + '7zG.exe" x "%1" -o*')
          }


          Of course, make sure that $7zInstallationFolder variable contains correct path to your 7-zip installation.






          share|improve this answer
























          • How to revert it? I uninstalling and reinstalling didn't work

            – Lombas
            May 9 '17 at 12:44











          • @Lombas try associating 7-zip again with those extensions, if it doesn't work remove registry keys and try it again.

            – xx77aBs
            May 10 '17 at 10:58











          • associating 7-zip again with the extensions worked. Thank you very much!

            – Lombas
            May 12 '17 at 10:49



















          0














          Pass parameters like this:



          7z x "%1" -o"%1.d"




          I recall hearing complaints about Windows 7 not allowing to directly edit file actions. I don't know if this is true or not... but if it is, save the following as a *.reg file and import it.



          Windows Registry Editor Version 5.00

          [HKEY_CURRENT_USERSoftwareClasses7-Zip.7zshellextract]
          @="Extract to folder"

          [HKEY_CURRENT_USERSoftwareClasses7-Zip.7zshellextractcommand]
          @="7z.exe x "%1" -o"%1.d""





          share|improve this answer

































            0














            Here is a .reg file that configures Extract to folder as the default behavior when double-clicking files with one of the following extensions - 7z/CAB/GZ/GZIP/RAR/TAR/ZIP. You could do it for other file extensions using the same approach. I prefer the Windows default behavior for ISO/VHD mounting, so I didn't change that, and 7-Zip supports many other file types that I don't commonly encounter so I didn't change it for those.



            You can revert this by going into 7-Zip File Manager, Tools, Options, and change the file associations as desired.



            I tested on Windows 10 x64/7-Zip 15.12 x64. Because it uses C:Program Files for the path to 7-Zip, you definitely need x64 Windows + x64 7-Zip, but I only tested on Windows 10.



            You will have the same right-click options as before, this only changes what happens when you double-click, and only for those seven file types (again, you could do this for other file types using the same approach).



            If there is already a folder of that name, it will give you the same 7-Zip prompt you get normally, with options for Yes/Yes to All/Auto Rename/No/No to All.




            Windows Registry Editor Version 5.00
            [HKEY_CURRENT_USERSOFTWAREClasses.7z]
            @="7-Zip.7z"
            [HKEY_CURRENT_USERSOFTWAREClasses.cab]
            @="7-Zip.cab"
            [HKEY_CURRENT_USERSOFTWAREClasses.gz]
            @="7-Zip.gz"
            [HKEY_CURRENT_USERSOFTWAREClasses.gzip]
            @="7-Zip.gzip"
            [HKEY_CURRENT_USERSOFTWAREClasses.rar]
            @="7-Zip.rar"
            [HKEY_CURRENT_USERSOFTWAREClasses.tar]
            @="7-Zip.tar"
            [HKEY_CURRENT_USERSOFTWAREClasses.zip]
            @="7-Zip.zip"
            [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.7z]
            @="7z Archive"
            [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.7zDefaultIcon]
            @="C:Program Files7-Zip7z.dll,0"
            [HKEY_CLASSES_ROOT7-Zip.7zshell]
            @="extract"
            [HKEY_CLASSES_ROOT7-Zip.7zshellextract]
            @="Extract to Folder"
            [HKEY_CLASSES_ROOT7-Zip.7zshellextractcommand]
            @=""C:Program Files7-Zip7zG.exe" x "%1" -o*"
            [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.7zshellopen]
            @=""
            [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.7zshellopencommand]
            @=""C:Program Files7-Zip7zFM.exe" "%1""
            [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.cab]
            @="cab Archive"
            [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.cabDefaultIcon]
            @="C:Program Files7-Zip7z.dll,7"
            [HKEY_CLASSES_ROOT7-Zip.cabshell]
            @="extract"
            [HKEY_CLASSES_ROOT7-Zip.cabshellextract]
            @="Extract to Folder"
            [HKEY_CLASSES_ROOT7-Zip.cabshellextractcommand]
            @=""C:Program Files7-Zip7zG.exe" x "%1" -o*"
            [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.cabshellopen]
            @=""
            [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.cabshellopencommand]
            @=""C:Program Files7-Zip7zFM.exe" "%1""
            [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.gz]
            @="gz Archive"
            [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.gzDefaultIcon]
            @="C:Program Files7-Zip7z.dll,14"
            [HKEY_CLASSES_ROOT7-Zip.gzshell]
            @="extract"
            [HKEY_CLASSES_ROOT7-Zip.gzshellextract]
            @="Extract to Folder"
            [HKEY_CLASSES_ROOT7-Zip.gzshellextractcommand]
            @=""C:Program Files7-Zip7zG.exe" x "%1" -o*"
            [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.gzshellopen]
            @=""
            [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.gzshellopencommand]
            @=""C:Program Files7-Zip7zFM.exe" "%1""
            [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.gzip]
            @="gzip Archive"
            [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.gzipDefaultIcon]
            @="C:Program Files7-Zip7z.dll,14"
            [HKEY_CLASSES_ROOT7-Zip.gzipshell]
            @="extract"
            [HKEY_CLASSES_ROOT7-Zip.gzipshellextract]
            @="Extract to Folder"
            [HKEY_CLASSES_ROOT7-Zip.gzipshellextractcommand]
            @=""C:Program Files7-Zip7zG.exe" x "%1" -o*"
            [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.gzipshellopen]
            @=""
            [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.gzipshellopencommand]
            @=""C:Program Files7-Zip7zFM.exe" "%1""
            [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.rar]
            @="rar Archive"
            [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.rarDefaultIcon]
            @="C:Program Files7-Zip7z.dll,3"
            [HKEY_CLASSES_ROOT7-Zip.rarshell]
            @="extract"
            [HKEY_CLASSES_ROOT7-Zip.rarshellextract]
            @="Extract to Folder"
            [HKEY_CLASSES_ROOT7-Zip.rarshellextractcommand]
            @=""C:Program Files7-Zip7zG.exe" x "%1" -o*"
            [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.rarshellopen]
            @=""
            [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.rarshellopencommand]
            @=""C:Program Files7-Zip7zFM.exe" "%1""
            [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.tar]
            @="tar Archive"
            [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.tarDefaultIcon]
            @="C:Program Files7-Zip7z.dll,13"
            [HKEY_CLASSES_ROOT7-Zip.tarshell]
            @="extract"
            [HKEY_CLASSES_ROOT7-Zip.tarshellextract]
            @="Extract to Folder"
            [HKEY_CLASSES_ROOT7-Zip.tarshellextractcommand]
            @=""C:Program Files7-Zip7zG.exe" x "%1" -o*"
            [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.tarshellopen]
            @=""
            [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.tarshellopencommand]
            @=""C:Program Files7-Zip7zFM.exe" "%1""
            [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.zip]
            @="zip Archive"
            [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.zipDefaultIcon]
            @="C:Program Files7-Zip7z.dll,1"
            [HKEY_CLASSES_ROOT7-Zip.zipshell]
            @="extract"
            [HKEY_CLASSES_ROOT7-Zip.zipshellextract]
            @="Extract to Folder"
            [HKEY_CLASSES_ROOT7-Zip.zipshellextractcommand]
            @=""C:Program Files7-Zip7zG.exe" x "%1" -o*"
            [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.zipshellopen]
            @=""
            [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.zipshellopencommand]
            @=""C:Program Files7-Zip7zFM.exe" "%1""





            share|improve this answer






















              protected by Community Aug 29 '15 at 22:30



              Thank you for your interest in this question.
              Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).



              Would you like to answer one of these unanswered questions instead?














              6 Answers
              6






              active

              oldest

              votes








              6 Answers
              6






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              4














              Unfortunately, afrazier's batch program method won't work; Windows doesn't handle opening multiple files like that. When you try to open multiple files with a program, Windows doesn't open a single instance of the program and pass the files as multiple arguments to that one instance. Instead, Windows opens many instances of the program (as many instances as there are files), passing one file to each instance. It would be nice if you could just use %* and pass a bunch of files to a single .bat, and have that .bat run a loop processing each file one at a time, but unfortunately you can only use %1 when setting these kinds of actions in the registry.



              Someone with some time on their hands could write a program that uses a mutex object to check if there is another instance already running, and if there is, to pass it's file to that instance and then close, whereon the original instance will put that file in a queue and get to it once it's done processing its own file. a batch could do the trick using tasklist and find, too, but that's not as good of a solution as mutex.



              Anyway, try this for your extract command registry value to get the right folder name:



              "pathto7z.exe" x "%1" -o* -aou


              This will create a new folder in the same directory as the source archive with the same name as the source archive (sans the file extension).



              Also, I added the -aou switch to automatically avoid filename conflicts (7z will append a number to the end of a file instead prompting you whether you want to overwrite or whatever).






              share|improve this answer


























              • Is there a way to do as -o* does, but only if there's more than one file in the archive? As in, can I make it extract to the current directory if there's only one file or folder in the archive?

                – NightExcessive
                Jun 26 '16 at 0:18











              • Default in Windows 10 is "C:Program Files7-Zip7zFM.exe" x "%1" -o* -aou so change the 7zFM to just 7z "C:Program Files7-Zip7z.exe" x "%1" -o* -aou

                – jsherk
                Dec 2 '17 at 17:36
















              4














              Unfortunately, afrazier's batch program method won't work; Windows doesn't handle opening multiple files like that. When you try to open multiple files with a program, Windows doesn't open a single instance of the program and pass the files as multiple arguments to that one instance. Instead, Windows opens many instances of the program (as many instances as there are files), passing one file to each instance. It would be nice if you could just use %* and pass a bunch of files to a single .bat, and have that .bat run a loop processing each file one at a time, but unfortunately you can only use %1 when setting these kinds of actions in the registry.



              Someone with some time on their hands could write a program that uses a mutex object to check if there is another instance already running, and if there is, to pass it's file to that instance and then close, whereon the original instance will put that file in a queue and get to it once it's done processing its own file. a batch could do the trick using tasklist and find, too, but that's not as good of a solution as mutex.



              Anyway, try this for your extract command registry value to get the right folder name:



              "pathto7z.exe" x "%1" -o* -aou


              This will create a new folder in the same directory as the source archive with the same name as the source archive (sans the file extension).



              Also, I added the -aou switch to automatically avoid filename conflicts (7z will append a number to the end of a file instead prompting you whether you want to overwrite or whatever).






              share|improve this answer


























              • Is there a way to do as -o* does, but only if there's more than one file in the archive? As in, can I make it extract to the current directory if there's only one file or folder in the archive?

                – NightExcessive
                Jun 26 '16 at 0:18











              • Default in Windows 10 is "C:Program Files7-Zip7zFM.exe" x "%1" -o* -aou so change the 7zFM to just 7z "C:Program Files7-Zip7z.exe" x "%1" -o* -aou

                – jsherk
                Dec 2 '17 at 17:36














              4












              4








              4







              Unfortunately, afrazier's batch program method won't work; Windows doesn't handle opening multiple files like that. When you try to open multiple files with a program, Windows doesn't open a single instance of the program and pass the files as multiple arguments to that one instance. Instead, Windows opens many instances of the program (as many instances as there are files), passing one file to each instance. It would be nice if you could just use %* and pass a bunch of files to a single .bat, and have that .bat run a loop processing each file one at a time, but unfortunately you can only use %1 when setting these kinds of actions in the registry.



              Someone with some time on their hands could write a program that uses a mutex object to check if there is another instance already running, and if there is, to pass it's file to that instance and then close, whereon the original instance will put that file in a queue and get to it once it's done processing its own file. a batch could do the trick using tasklist and find, too, but that's not as good of a solution as mutex.



              Anyway, try this for your extract command registry value to get the right folder name:



              "pathto7z.exe" x "%1" -o* -aou


              This will create a new folder in the same directory as the source archive with the same name as the source archive (sans the file extension).



              Also, I added the -aou switch to automatically avoid filename conflicts (7z will append a number to the end of a file instead prompting you whether you want to overwrite or whatever).






              share|improve this answer















              Unfortunately, afrazier's batch program method won't work; Windows doesn't handle opening multiple files like that. When you try to open multiple files with a program, Windows doesn't open a single instance of the program and pass the files as multiple arguments to that one instance. Instead, Windows opens many instances of the program (as many instances as there are files), passing one file to each instance. It would be nice if you could just use %* and pass a bunch of files to a single .bat, and have that .bat run a loop processing each file one at a time, but unfortunately you can only use %1 when setting these kinds of actions in the registry.



              Someone with some time on their hands could write a program that uses a mutex object to check if there is another instance already running, and if there is, to pass it's file to that instance and then close, whereon the original instance will put that file in a queue and get to it once it's done processing its own file. a batch could do the trick using tasklist and find, too, but that's not as good of a solution as mutex.



              Anyway, try this for your extract command registry value to get the right folder name:



              "pathto7z.exe" x "%1" -o* -aou


              This will create a new folder in the same directory as the source archive with the same name as the source archive (sans the file extension).



              Also, I added the -aou switch to automatically avoid filename conflicts (7z will append a number to the end of a file instead prompting you whether you want to overwrite or whatever).







              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Mar 20 '17 at 10:16









              Community

              1




              1










              answered Apr 26 '11 at 15:50









              Justin RoettgerJustin Roettger

              562




              562













              • Is there a way to do as -o* does, but only if there's more than one file in the archive? As in, can I make it extract to the current directory if there's only one file or folder in the archive?

                – NightExcessive
                Jun 26 '16 at 0:18











              • Default in Windows 10 is "C:Program Files7-Zip7zFM.exe" x "%1" -o* -aou so change the 7zFM to just 7z "C:Program Files7-Zip7z.exe" x "%1" -o* -aou

                – jsherk
                Dec 2 '17 at 17:36



















              • Is there a way to do as -o* does, but only if there's more than one file in the archive? As in, can I make it extract to the current directory if there's only one file or folder in the archive?

                – NightExcessive
                Jun 26 '16 at 0:18











              • Default in Windows 10 is "C:Program Files7-Zip7zFM.exe" x "%1" -o* -aou so change the 7zFM to just 7z "C:Program Files7-Zip7z.exe" x "%1" -o* -aou

                – jsherk
                Dec 2 '17 at 17:36

















              Is there a way to do as -o* does, but only if there's more than one file in the archive? As in, can I make it extract to the current directory if there's only one file or folder in the archive?

              – NightExcessive
              Jun 26 '16 at 0:18





              Is there a way to do as -o* does, but only if there's more than one file in the archive? As in, can I make it extract to the current directory if there's only one file or folder in the archive?

              – NightExcessive
              Jun 26 '16 at 0:18













              Default in Windows 10 is "C:Program Files7-Zip7zFM.exe" x "%1" -o* -aou so change the 7zFM to just 7z "C:Program Files7-Zip7z.exe" x "%1" -o* -aou

              – jsherk
              Dec 2 '17 at 17:36





              Default in Windows 10 is "C:Program Files7-Zip7zFM.exe" x "%1" -o* -aou so change the 7zFM to just 7z "C:Program Files7-Zip7z.exe" x "%1" -o* -aou

              – jsherk
              Dec 2 '17 at 17:36













              11














              This thread has become a bit confusing because of contradicting answers (it took me quite some time to figure out which was the right solution) so I thought it might be a good idea to summarize the results from afrazier's and Justin Roettger's posts combinded with my own experiences:




              1. Start regedit as administrator

              2. Open HKEY_CLASSES_ROOT7-Zip.7z

              3. Under that key, expand the Shell sub-key

              4. Set the (Default) value to the string extract

              5. Create a new sub-key named extract

              6. Set the (Default) value for the extract key to Extract to
                Folder


              7. Create a new sub-key under extract named command

              8. Set the (Default) value of the command key to:



              C:Program Files7-Zip7zG.exe x "%1" -o*




              (you might have to adjust this to match the path of your 7-Zip installation)



              Instead of 7z with -aou like Justin Roettger suggested I ended up using 7zG, because this way you can choose to overwrite if you like just like extracting with the normal context menu.



              That's it! 7z files are now extracted to a folder with their own name by double click. For other extensions like .rar and .zip you need to repeat these steps for the according keys.
              (i.e. HKEY_CLASSES_ROOT7-Zip.rar and HKEY_CLASSES_ROOT7-Zip.zip and so on)



              Oh and to clarify: It does work with multiple files selected as well. No batch file need.






              share|improve this answer





















              • 1





                I don't see that registry path. I'm on Windows 8 w/ 64-bit 7zip.

                – phillipwei
                Jun 18 '14 at 18:40











              • Lots has changed since this post, but it still works great ... for me, it was under 7z_auto_file, not 7-Zip.7z. All I did was change the existing "command" to C:Program Files7-Zip7zG.exe x "%1" -o* and voila.

                – neokio
                Dec 21 '15 at 7:35











              • On Windows 10, I also didn't see the path until I associated at least one file with 7-Zip in the 7-Zip File Manager (via Tools -> Options... menu).

                – Chris Nolet
                May 4 '17 at 20:50
















              11














              This thread has become a bit confusing because of contradicting answers (it took me quite some time to figure out which was the right solution) so I thought it might be a good idea to summarize the results from afrazier's and Justin Roettger's posts combinded with my own experiences:




              1. Start regedit as administrator

              2. Open HKEY_CLASSES_ROOT7-Zip.7z

              3. Under that key, expand the Shell sub-key

              4. Set the (Default) value to the string extract

              5. Create a new sub-key named extract

              6. Set the (Default) value for the extract key to Extract to
                Folder


              7. Create a new sub-key under extract named command

              8. Set the (Default) value of the command key to:



              C:Program Files7-Zip7zG.exe x "%1" -o*




              (you might have to adjust this to match the path of your 7-Zip installation)



              Instead of 7z with -aou like Justin Roettger suggested I ended up using 7zG, because this way you can choose to overwrite if you like just like extracting with the normal context menu.



              That's it! 7z files are now extracted to a folder with their own name by double click. For other extensions like .rar and .zip you need to repeat these steps for the according keys.
              (i.e. HKEY_CLASSES_ROOT7-Zip.rar and HKEY_CLASSES_ROOT7-Zip.zip and so on)



              Oh and to clarify: It does work with multiple files selected as well. No batch file need.






              share|improve this answer





















              • 1





                I don't see that registry path. I'm on Windows 8 w/ 64-bit 7zip.

                – phillipwei
                Jun 18 '14 at 18:40











              • Lots has changed since this post, but it still works great ... for me, it was under 7z_auto_file, not 7-Zip.7z. All I did was change the existing "command" to C:Program Files7-Zip7zG.exe x "%1" -o* and voila.

                – neokio
                Dec 21 '15 at 7:35











              • On Windows 10, I also didn't see the path until I associated at least one file with 7-Zip in the 7-Zip File Manager (via Tools -> Options... menu).

                – Chris Nolet
                May 4 '17 at 20:50














              11












              11








              11







              This thread has become a bit confusing because of contradicting answers (it took me quite some time to figure out which was the right solution) so I thought it might be a good idea to summarize the results from afrazier's and Justin Roettger's posts combinded with my own experiences:




              1. Start regedit as administrator

              2. Open HKEY_CLASSES_ROOT7-Zip.7z

              3. Under that key, expand the Shell sub-key

              4. Set the (Default) value to the string extract

              5. Create a new sub-key named extract

              6. Set the (Default) value for the extract key to Extract to
                Folder


              7. Create a new sub-key under extract named command

              8. Set the (Default) value of the command key to:



              C:Program Files7-Zip7zG.exe x "%1" -o*




              (you might have to adjust this to match the path of your 7-Zip installation)



              Instead of 7z with -aou like Justin Roettger suggested I ended up using 7zG, because this way you can choose to overwrite if you like just like extracting with the normal context menu.



              That's it! 7z files are now extracted to a folder with their own name by double click. For other extensions like .rar and .zip you need to repeat these steps for the according keys.
              (i.e. HKEY_CLASSES_ROOT7-Zip.rar and HKEY_CLASSES_ROOT7-Zip.zip and so on)



              Oh and to clarify: It does work with multiple files selected as well. No batch file need.






              share|improve this answer















              This thread has become a bit confusing because of contradicting answers (it took me quite some time to figure out which was the right solution) so I thought it might be a good idea to summarize the results from afrazier's and Justin Roettger's posts combinded with my own experiences:




              1. Start regedit as administrator

              2. Open HKEY_CLASSES_ROOT7-Zip.7z

              3. Under that key, expand the Shell sub-key

              4. Set the (Default) value to the string extract

              5. Create a new sub-key named extract

              6. Set the (Default) value for the extract key to Extract to
                Folder


              7. Create a new sub-key under extract named command

              8. Set the (Default) value of the command key to:



              C:Program Files7-Zip7zG.exe x "%1" -o*




              (you might have to adjust this to match the path of your 7-Zip installation)



              Instead of 7z with -aou like Justin Roettger suggested I ended up using 7zG, because this way you can choose to overwrite if you like just like extracting with the normal context menu.



              That's it! 7z files are now extracted to a folder with their own name by double click. For other extensions like .rar and .zip you need to repeat these steps for the according keys.
              (i.e. HKEY_CLASSES_ROOT7-Zip.rar and HKEY_CLASSES_ROOT7-Zip.zip and so on)



              Oh and to clarify: It does work with multiple files selected as well. No batch file need.







              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Jan 15 at 0:23









              Community

              1




              1










              answered Jul 11 '12 at 20:12









              haiggohhaiggoh

              11314




              11314








              • 1





                I don't see that registry path. I'm on Windows 8 w/ 64-bit 7zip.

                – phillipwei
                Jun 18 '14 at 18:40











              • Lots has changed since this post, but it still works great ... for me, it was under 7z_auto_file, not 7-Zip.7z. All I did was change the existing "command" to C:Program Files7-Zip7zG.exe x "%1" -o* and voila.

                – neokio
                Dec 21 '15 at 7:35











              • On Windows 10, I also didn't see the path until I associated at least one file with 7-Zip in the 7-Zip File Manager (via Tools -> Options... menu).

                – Chris Nolet
                May 4 '17 at 20:50














              • 1





                I don't see that registry path. I'm on Windows 8 w/ 64-bit 7zip.

                – phillipwei
                Jun 18 '14 at 18:40











              • Lots has changed since this post, but it still works great ... for me, it was under 7z_auto_file, not 7-Zip.7z. All I did was change the existing "command" to C:Program Files7-Zip7zG.exe x "%1" -o* and voila.

                – neokio
                Dec 21 '15 at 7:35











              • On Windows 10, I also didn't see the path until I associated at least one file with 7-Zip in the 7-Zip File Manager (via Tools -> Options... menu).

                – Chris Nolet
                May 4 '17 at 20:50








              1




              1





              I don't see that registry path. I'm on Windows 8 w/ 64-bit 7zip.

              – phillipwei
              Jun 18 '14 at 18:40





              I don't see that registry path. I'm on Windows 8 w/ 64-bit 7zip.

              – phillipwei
              Jun 18 '14 at 18:40













              Lots has changed since this post, but it still works great ... for me, it was under 7z_auto_file, not 7-Zip.7z. All I did was change the existing "command" to C:Program Files7-Zip7zG.exe x "%1" -o* and voila.

              – neokio
              Dec 21 '15 at 7:35





              Lots has changed since this post, but it still works great ... for me, it was under 7z_auto_file, not 7-Zip.7z. All I did was change the existing "command" to C:Program Files7-Zip7zG.exe x "%1" -o* and voila.

              – neokio
              Dec 21 '15 at 7:35













              On Windows 10, I also didn't see the path until I associated at least one file with 7-Zip in the 7-Zip File Manager (via Tools -> Options... menu).

              – Chris Nolet
              May 4 '17 at 20:50





              On Windows 10, I also didn't see the path until I associated at least one file with 7-Zip in the 7-Zip File Manager (via Tools -> Options... menu).

              – Chris Nolet
              May 4 '17 at 20:50











              5














              The easy way



              Install ExtractNow. You can configure it to do exactly what you want.





              The hard way



              Manual registry modification as follows...




              • Start regedit as administrator


              • Open HKCR.7z and look at the (Default) value. Take note of what that is (in my case, as a PowerArchiver user, it's PASZIP)


              • Go to the registry key in HKCR named that. (in my case HKCRPASZIP)


              • Under that key, expand the Shell sub-key


              • Set the (Default) value to the string extract


              • Create a new sub-key named extract


              • Set the (Default) value for the extract key to Extract to Folder


              • Create a new sub-key under extract named command



              • Set the (Default) value of the command key to



                C:Program Files7-Zip7zG.exe x "%1" -o* -aou


                (you might have to adjust the path)




              Thanks to Justin Roettger for pointing out the correct name variable needed for this.



              That should be it. Now 7z files are extracted to a folder with their own name by double click. For other extensions like .rar and .zip you need to repeat this steps for the according keys.



              If you only want to make the changes on your user account instead of system-wide, modify HKCUSoftwareClasses instead of HKCR. HKCR is a virtual key that's a union of HKLMSoftwareClasses and HKCUSoftwareClasses where the data in your account (HKCU) overrides the system-wide data (HKLM). Normally running regedit as an Administrator means that modifying HKCR alters system-wide data in HKLM.





              Extracting multiple files



              Of course, this won't work if you have multiple files selected. If you want that to work, you need to create the following batch file:



              @echo off
              :top
              if "%1"=="" goto :EOF
              7z.exe x "%1" -o"%~dpn1"
              shift
              goto top


              Now, follow the instructions above. In the very last step, set the (Default) value of the command key to C:PathToFile.bat %*



              All of the registry modifications are untested from memory, but should be correct.






              share|improve this answer


























              • Does %~dpn1 work in file associations? (It doesn't in Windows XP. Also, you forgot x for extension.)

                – grawity
                Mar 18 '11 at 20:46






              • 1





                @grawity: You don't want the x in the output folder name. As for it working... That's a good question. I'll edit to address...

                – afrazier
                Mar 18 '11 at 20:48











              • Hm, good point.

                – grawity
                Mar 18 '11 at 21:12











              • So close, but not quite there yet. After playing with the code both afrazier and grawity provided, I have the default key value set as "C:Program Files7-Zip7z.exe" x "%1" -o"%~dpn1" I wasn't getting any benefit from running cmd.exe that I could tell, and 7-zip's default open didn't bother with it. However, this is just unzipping to %~dpn1 in the same folder as the zip file. The "%1.d" gives a filename.zip.d subdirectory in the same folder as the zip file, so it's closer, but not stripping off the extension. I've tried hybrids of the two, no luck. Any other suggestions?

                – schodge
                Mar 25 '11 at 1:43













              • You'll probably have to use a batch file.

                – afrazier
                Mar 25 '11 at 3:51
















              5














              The easy way



              Install ExtractNow. You can configure it to do exactly what you want.





              The hard way



              Manual registry modification as follows...




              • Start regedit as administrator


              • Open HKCR.7z and look at the (Default) value. Take note of what that is (in my case, as a PowerArchiver user, it's PASZIP)


              • Go to the registry key in HKCR named that. (in my case HKCRPASZIP)


              • Under that key, expand the Shell sub-key


              • Set the (Default) value to the string extract


              • Create a new sub-key named extract


              • Set the (Default) value for the extract key to Extract to Folder


              • Create a new sub-key under extract named command



              • Set the (Default) value of the command key to



                C:Program Files7-Zip7zG.exe x "%1" -o* -aou


                (you might have to adjust the path)




              Thanks to Justin Roettger for pointing out the correct name variable needed for this.



              That should be it. Now 7z files are extracted to a folder with their own name by double click. For other extensions like .rar and .zip you need to repeat this steps for the according keys.



              If you only want to make the changes on your user account instead of system-wide, modify HKCUSoftwareClasses instead of HKCR. HKCR is a virtual key that's a union of HKLMSoftwareClasses and HKCUSoftwareClasses where the data in your account (HKCU) overrides the system-wide data (HKLM). Normally running regedit as an Administrator means that modifying HKCR alters system-wide data in HKLM.





              Extracting multiple files



              Of course, this won't work if you have multiple files selected. If you want that to work, you need to create the following batch file:



              @echo off
              :top
              if "%1"=="" goto :EOF
              7z.exe x "%1" -o"%~dpn1"
              shift
              goto top


              Now, follow the instructions above. In the very last step, set the (Default) value of the command key to C:PathToFile.bat %*



              All of the registry modifications are untested from memory, but should be correct.






              share|improve this answer


























              • Does %~dpn1 work in file associations? (It doesn't in Windows XP. Also, you forgot x for extension.)

                – grawity
                Mar 18 '11 at 20:46






              • 1





                @grawity: You don't want the x in the output folder name. As for it working... That's a good question. I'll edit to address...

                – afrazier
                Mar 18 '11 at 20:48











              • Hm, good point.

                – grawity
                Mar 18 '11 at 21:12











              • So close, but not quite there yet. After playing with the code both afrazier and grawity provided, I have the default key value set as "C:Program Files7-Zip7z.exe" x "%1" -o"%~dpn1" I wasn't getting any benefit from running cmd.exe that I could tell, and 7-zip's default open didn't bother with it. However, this is just unzipping to %~dpn1 in the same folder as the zip file. The "%1.d" gives a filename.zip.d subdirectory in the same folder as the zip file, so it's closer, but not stripping off the extension. I've tried hybrids of the two, no luck. Any other suggestions?

                – schodge
                Mar 25 '11 at 1:43













              • You'll probably have to use a batch file.

                – afrazier
                Mar 25 '11 at 3:51














              5












              5








              5







              The easy way



              Install ExtractNow. You can configure it to do exactly what you want.





              The hard way



              Manual registry modification as follows...




              • Start regedit as administrator


              • Open HKCR.7z and look at the (Default) value. Take note of what that is (in my case, as a PowerArchiver user, it's PASZIP)


              • Go to the registry key in HKCR named that. (in my case HKCRPASZIP)


              • Under that key, expand the Shell sub-key


              • Set the (Default) value to the string extract


              • Create a new sub-key named extract


              • Set the (Default) value for the extract key to Extract to Folder


              • Create a new sub-key under extract named command



              • Set the (Default) value of the command key to



                C:Program Files7-Zip7zG.exe x "%1" -o* -aou


                (you might have to adjust the path)




              Thanks to Justin Roettger for pointing out the correct name variable needed for this.



              That should be it. Now 7z files are extracted to a folder with their own name by double click. For other extensions like .rar and .zip you need to repeat this steps for the according keys.



              If you only want to make the changes on your user account instead of system-wide, modify HKCUSoftwareClasses instead of HKCR. HKCR is a virtual key that's a union of HKLMSoftwareClasses and HKCUSoftwareClasses where the data in your account (HKCU) overrides the system-wide data (HKLM). Normally running regedit as an Administrator means that modifying HKCR alters system-wide data in HKLM.





              Extracting multiple files



              Of course, this won't work if you have multiple files selected. If you want that to work, you need to create the following batch file:



              @echo off
              :top
              if "%1"=="" goto :EOF
              7z.exe x "%1" -o"%~dpn1"
              shift
              goto top


              Now, follow the instructions above. In the very last step, set the (Default) value of the command key to C:PathToFile.bat %*



              All of the registry modifications are untested from memory, but should be correct.






              share|improve this answer















              The easy way



              Install ExtractNow. You can configure it to do exactly what you want.





              The hard way



              Manual registry modification as follows...




              • Start regedit as administrator


              • Open HKCR.7z and look at the (Default) value. Take note of what that is (in my case, as a PowerArchiver user, it's PASZIP)


              • Go to the registry key in HKCR named that. (in my case HKCRPASZIP)


              • Under that key, expand the Shell sub-key


              • Set the (Default) value to the string extract


              • Create a new sub-key named extract


              • Set the (Default) value for the extract key to Extract to Folder


              • Create a new sub-key under extract named command



              • Set the (Default) value of the command key to



                C:Program Files7-Zip7zG.exe x "%1" -o* -aou


                (you might have to adjust the path)




              Thanks to Justin Roettger for pointing out the correct name variable needed for this.



              That should be it. Now 7z files are extracted to a folder with their own name by double click. For other extensions like .rar and .zip you need to repeat this steps for the according keys.



              If you only want to make the changes on your user account instead of system-wide, modify HKCUSoftwareClasses instead of HKCR. HKCR is a virtual key that's a union of HKLMSoftwareClasses and HKCUSoftwareClasses where the data in your account (HKCU) overrides the system-wide data (HKLM). Normally running regedit as an Administrator means that modifying HKCR alters system-wide data in HKLM.





              Extracting multiple files



              Of course, this won't work if you have multiple files selected. If you want that to work, you need to create the following batch file:



              @echo off
              :top
              if "%1"=="" goto :EOF
              7z.exe x "%1" -o"%~dpn1"
              shift
              goto top


              Now, follow the instructions above. In the very last step, set the (Default) value of the command key to C:PathToFile.bat %*



              All of the registry modifications are untested from memory, but should be correct.







              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Jul 20 '12 at 16:36









              slhck

              161k47447470




              161k47447470










              answered Mar 18 '11 at 20:40









              afrazierafrazier

              20.6k24682




              20.6k24682













              • Does %~dpn1 work in file associations? (It doesn't in Windows XP. Also, you forgot x for extension.)

                – grawity
                Mar 18 '11 at 20:46






              • 1





                @grawity: You don't want the x in the output folder name. As for it working... That's a good question. I'll edit to address...

                – afrazier
                Mar 18 '11 at 20:48











              • Hm, good point.

                – grawity
                Mar 18 '11 at 21:12











              • So close, but not quite there yet. After playing with the code both afrazier and grawity provided, I have the default key value set as "C:Program Files7-Zip7z.exe" x "%1" -o"%~dpn1" I wasn't getting any benefit from running cmd.exe that I could tell, and 7-zip's default open didn't bother with it. However, this is just unzipping to %~dpn1 in the same folder as the zip file. The "%1.d" gives a filename.zip.d subdirectory in the same folder as the zip file, so it's closer, but not stripping off the extension. I've tried hybrids of the two, no luck. Any other suggestions?

                – schodge
                Mar 25 '11 at 1:43













              • You'll probably have to use a batch file.

                – afrazier
                Mar 25 '11 at 3:51



















              • Does %~dpn1 work in file associations? (It doesn't in Windows XP. Also, you forgot x for extension.)

                – grawity
                Mar 18 '11 at 20:46






              • 1





                @grawity: You don't want the x in the output folder name. As for it working... That's a good question. I'll edit to address...

                – afrazier
                Mar 18 '11 at 20:48











              • Hm, good point.

                – grawity
                Mar 18 '11 at 21:12











              • So close, but not quite there yet. After playing with the code both afrazier and grawity provided, I have the default key value set as "C:Program Files7-Zip7z.exe" x "%1" -o"%~dpn1" I wasn't getting any benefit from running cmd.exe that I could tell, and 7-zip's default open didn't bother with it. However, this is just unzipping to %~dpn1 in the same folder as the zip file. The "%1.d" gives a filename.zip.d subdirectory in the same folder as the zip file, so it's closer, but not stripping off the extension. I've tried hybrids of the two, no luck. Any other suggestions?

                – schodge
                Mar 25 '11 at 1:43













              • You'll probably have to use a batch file.

                – afrazier
                Mar 25 '11 at 3:51

















              Does %~dpn1 work in file associations? (It doesn't in Windows XP. Also, you forgot x for extension.)

              – grawity
              Mar 18 '11 at 20:46





              Does %~dpn1 work in file associations? (It doesn't in Windows XP. Also, you forgot x for extension.)

              – grawity
              Mar 18 '11 at 20:46




              1




              1





              @grawity: You don't want the x in the output folder name. As for it working... That's a good question. I'll edit to address...

              – afrazier
              Mar 18 '11 at 20:48





              @grawity: You don't want the x in the output folder name. As for it working... That's a good question. I'll edit to address...

              – afrazier
              Mar 18 '11 at 20:48













              Hm, good point.

              – grawity
              Mar 18 '11 at 21:12





              Hm, good point.

              – grawity
              Mar 18 '11 at 21:12













              So close, but not quite there yet. After playing with the code both afrazier and grawity provided, I have the default key value set as "C:Program Files7-Zip7z.exe" x "%1" -o"%~dpn1" I wasn't getting any benefit from running cmd.exe that I could tell, and 7-zip's default open didn't bother with it. However, this is just unzipping to %~dpn1 in the same folder as the zip file. The "%1.d" gives a filename.zip.d subdirectory in the same folder as the zip file, so it's closer, but not stripping off the extension. I've tried hybrids of the two, no luck. Any other suggestions?

              – schodge
              Mar 25 '11 at 1:43







              So close, but not quite there yet. After playing with the code both afrazier and grawity provided, I have the default key value set as "C:Program Files7-Zip7z.exe" x "%1" -o"%~dpn1" I wasn't getting any benefit from running cmd.exe that I could tell, and 7-zip's default open didn't bother with it. However, this is just unzipping to %~dpn1 in the same folder as the zip file. The "%1.d" gives a filename.zip.d subdirectory in the same folder as the zip file, so it's closer, but not stripping off the extension. I've tried hybrids of the two, no luck. Any other suggestions?

              – schodge
              Mar 25 '11 at 1:43















              You'll probably have to use a batch file.

              – afrazier
              Mar 25 '11 at 3:51





              You'll probably have to use a batch file.

              – afrazier
              Mar 25 '11 at 3:51











              2














              Here's PowerShell script I wrote based on @haiggoh's answer. Before you run it, you need to open 7-zip, go to Tools->Options and associate 7-zip with wanted file extensions. After that, run the following PowerShell script (with admin rights):



              $7zInstallationFolder = 'C:Program Files7-Zip'
              $reg = [Microsoft.Win32.RegistryKey]::OpenBaseKey([Microsoft.Win32.RegistryHive]::ClassesRoot, [Microsoft.Win32.RegistryView]::Default)
              $subKeys = $reg.GetSubKeyNames() | where { $_ -match '7-Zip.' }
              foreach ($keyName in $subKeys) {
              $key = $reg.OpenSubKey($keyName + 'shellopencommand', $true)
              $key.SetValue('', '"' + $7zInstallationFolder + '7zG.exe" x "%1" -o*')
              }


              Of course, make sure that $7zInstallationFolder variable contains correct path to your 7-zip installation.






              share|improve this answer
























              • How to revert it? I uninstalling and reinstalling didn't work

                – Lombas
                May 9 '17 at 12:44











              • @Lombas try associating 7-zip again with those extensions, if it doesn't work remove registry keys and try it again.

                – xx77aBs
                May 10 '17 at 10:58











              • associating 7-zip again with the extensions worked. Thank you very much!

                – Lombas
                May 12 '17 at 10:49
















              2














              Here's PowerShell script I wrote based on @haiggoh's answer. Before you run it, you need to open 7-zip, go to Tools->Options and associate 7-zip with wanted file extensions. After that, run the following PowerShell script (with admin rights):



              $7zInstallationFolder = 'C:Program Files7-Zip'
              $reg = [Microsoft.Win32.RegistryKey]::OpenBaseKey([Microsoft.Win32.RegistryHive]::ClassesRoot, [Microsoft.Win32.RegistryView]::Default)
              $subKeys = $reg.GetSubKeyNames() | where { $_ -match '7-Zip.' }
              foreach ($keyName in $subKeys) {
              $key = $reg.OpenSubKey($keyName + 'shellopencommand', $true)
              $key.SetValue('', '"' + $7zInstallationFolder + '7zG.exe" x "%1" -o*')
              }


              Of course, make sure that $7zInstallationFolder variable contains correct path to your 7-zip installation.






              share|improve this answer
























              • How to revert it? I uninstalling and reinstalling didn't work

                – Lombas
                May 9 '17 at 12:44











              • @Lombas try associating 7-zip again with those extensions, if it doesn't work remove registry keys and try it again.

                – xx77aBs
                May 10 '17 at 10:58











              • associating 7-zip again with the extensions worked. Thank you very much!

                – Lombas
                May 12 '17 at 10:49














              2












              2








              2







              Here's PowerShell script I wrote based on @haiggoh's answer. Before you run it, you need to open 7-zip, go to Tools->Options and associate 7-zip with wanted file extensions. After that, run the following PowerShell script (with admin rights):



              $7zInstallationFolder = 'C:Program Files7-Zip'
              $reg = [Microsoft.Win32.RegistryKey]::OpenBaseKey([Microsoft.Win32.RegistryHive]::ClassesRoot, [Microsoft.Win32.RegistryView]::Default)
              $subKeys = $reg.GetSubKeyNames() | where { $_ -match '7-Zip.' }
              foreach ($keyName in $subKeys) {
              $key = $reg.OpenSubKey($keyName + 'shellopencommand', $true)
              $key.SetValue('', '"' + $7zInstallationFolder + '7zG.exe" x "%1" -o*')
              }


              Of course, make sure that $7zInstallationFolder variable contains correct path to your 7-zip installation.






              share|improve this answer













              Here's PowerShell script I wrote based on @haiggoh's answer. Before you run it, you need to open 7-zip, go to Tools->Options and associate 7-zip with wanted file extensions. After that, run the following PowerShell script (with admin rights):



              $7zInstallationFolder = 'C:Program Files7-Zip'
              $reg = [Microsoft.Win32.RegistryKey]::OpenBaseKey([Microsoft.Win32.RegistryHive]::ClassesRoot, [Microsoft.Win32.RegistryView]::Default)
              $subKeys = $reg.GetSubKeyNames() | where { $_ -match '7-Zip.' }
              foreach ($keyName in $subKeys) {
              $key = $reg.OpenSubKey($keyName + 'shellopencommand', $true)
              $key.SetValue('', '"' + $7zInstallationFolder + '7zG.exe" x "%1" -o*')
              }


              Of course, make sure that $7zInstallationFolder variable contains correct path to your 7-zip installation.







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Sep 18 '15 at 22:22









              xx77aBsxx77aBs

              1911310




              1911310













              • How to revert it? I uninstalling and reinstalling didn't work

                – Lombas
                May 9 '17 at 12:44











              • @Lombas try associating 7-zip again with those extensions, if it doesn't work remove registry keys and try it again.

                – xx77aBs
                May 10 '17 at 10:58











              • associating 7-zip again with the extensions worked. Thank you very much!

                – Lombas
                May 12 '17 at 10:49



















              • How to revert it? I uninstalling and reinstalling didn't work

                – Lombas
                May 9 '17 at 12:44











              • @Lombas try associating 7-zip again with those extensions, if it doesn't work remove registry keys and try it again.

                – xx77aBs
                May 10 '17 at 10:58











              • associating 7-zip again with the extensions worked. Thank you very much!

                – Lombas
                May 12 '17 at 10:49

















              How to revert it? I uninstalling and reinstalling didn't work

              – Lombas
              May 9 '17 at 12:44





              How to revert it? I uninstalling and reinstalling didn't work

              – Lombas
              May 9 '17 at 12:44













              @Lombas try associating 7-zip again with those extensions, if it doesn't work remove registry keys and try it again.

              – xx77aBs
              May 10 '17 at 10:58





              @Lombas try associating 7-zip again with those extensions, if it doesn't work remove registry keys and try it again.

              – xx77aBs
              May 10 '17 at 10:58













              associating 7-zip again with the extensions worked. Thank you very much!

              – Lombas
              May 12 '17 at 10:49





              associating 7-zip again with the extensions worked. Thank you very much!

              – Lombas
              May 12 '17 at 10:49











              0














              Pass parameters like this:



              7z x "%1" -o"%1.d"




              I recall hearing complaints about Windows 7 not allowing to directly edit file actions. I don't know if this is true or not... but if it is, save the following as a *.reg file and import it.



              Windows Registry Editor Version 5.00

              [HKEY_CURRENT_USERSoftwareClasses7-Zip.7zshellextract]
              @="Extract to folder"

              [HKEY_CURRENT_USERSoftwareClasses7-Zip.7zshellextractcommand]
              @="7z.exe x "%1" -o"%1.d""





              share|improve this answer






























                0














                Pass parameters like this:



                7z x "%1" -o"%1.d"




                I recall hearing complaints about Windows 7 not allowing to directly edit file actions. I don't know if this is true or not... but if it is, save the following as a *.reg file and import it.



                Windows Registry Editor Version 5.00

                [HKEY_CURRENT_USERSoftwareClasses7-Zip.7zshellextract]
                @="Extract to folder"

                [HKEY_CURRENT_USERSoftwareClasses7-Zip.7zshellextractcommand]
                @="7z.exe x "%1" -o"%1.d""





                share|improve this answer




























                  0












                  0








                  0







                  Pass parameters like this:



                  7z x "%1" -o"%1.d"




                  I recall hearing complaints about Windows 7 not allowing to directly edit file actions. I don't know if this is true or not... but if it is, save the following as a *.reg file and import it.



                  Windows Registry Editor Version 5.00

                  [HKEY_CURRENT_USERSoftwareClasses7-Zip.7zshellextract]
                  @="Extract to folder"

                  [HKEY_CURRENT_USERSoftwareClasses7-Zip.7zshellextractcommand]
                  @="7z.exe x "%1" -o"%1.d""





                  share|improve this answer















                  Pass parameters like this:



                  7z x "%1" -o"%1.d"




                  I recall hearing complaints about Windows 7 not allowing to directly edit file actions. I don't know if this is true or not... but if it is, save the following as a *.reg file and import it.



                  Windows Registry Editor Version 5.00

                  [HKEY_CURRENT_USERSoftwareClasses7-Zip.7zshellextract]
                  @="Extract to folder"

                  [HKEY_CURRENT_USERSoftwareClasses7-Zip.7zshellextractcommand]
                  @="7z.exe x "%1" -o"%1.d""






                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Mar 18 '11 at 21:13

























                  answered Mar 18 '11 at 20:38









                  grawitygrawity

                  239k37508561




                  239k37508561























                      0














                      Here is a .reg file that configures Extract to folder as the default behavior when double-clicking files with one of the following extensions - 7z/CAB/GZ/GZIP/RAR/TAR/ZIP. You could do it for other file extensions using the same approach. I prefer the Windows default behavior for ISO/VHD mounting, so I didn't change that, and 7-Zip supports many other file types that I don't commonly encounter so I didn't change it for those.



                      You can revert this by going into 7-Zip File Manager, Tools, Options, and change the file associations as desired.



                      I tested on Windows 10 x64/7-Zip 15.12 x64. Because it uses C:Program Files for the path to 7-Zip, you definitely need x64 Windows + x64 7-Zip, but I only tested on Windows 10.



                      You will have the same right-click options as before, this only changes what happens when you double-click, and only for those seven file types (again, you could do this for other file types using the same approach).



                      If there is already a folder of that name, it will give you the same 7-Zip prompt you get normally, with options for Yes/Yes to All/Auto Rename/No/No to All.




                      Windows Registry Editor Version 5.00
                      [HKEY_CURRENT_USERSOFTWAREClasses.7z]
                      @="7-Zip.7z"
                      [HKEY_CURRENT_USERSOFTWAREClasses.cab]
                      @="7-Zip.cab"
                      [HKEY_CURRENT_USERSOFTWAREClasses.gz]
                      @="7-Zip.gz"
                      [HKEY_CURRENT_USERSOFTWAREClasses.gzip]
                      @="7-Zip.gzip"
                      [HKEY_CURRENT_USERSOFTWAREClasses.rar]
                      @="7-Zip.rar"
                      [HKEY_CURRENT_USERSOFTWAREClasses.tar]
                      @="7-Zip.tar"
                      [HKEY_CURRENT_USERSOFTWAREClasses.zip]
                      @="7-Zip.zip"
                      [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.7z]
                      @="7z Archive"
                      [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.7zDefaultIcon]
                      @="C:Program Files7-Zip7z.dll,0"
                      [HKEY_CLASSES_ROOT7-Zip.7zshell]
                      @="extract"
                      [HKEY_CLASSES_ROOT7-Zip.7zshellextract]
                      @="Extract to Folder"
                      [HKEY_CLASSES_ROOT7-Zip.7zshellextractcommand]
                      @=""C:Program Files7-Zip7zG.exe" x "%1" -o*"
                      [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.7zshellopen]
                      @=""
                      [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.7zshellopencommand]
                      @=""C:Program Files7-Zip7zFM.exe" "%1""
                      [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.cab]
                      @="cab Archive"
                      [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.cabDefaultIcon]
                      @="C:Program Files7-Zip7z.dll,7"
                      [HKEY_CLASSES_ROOT7-Zip.cabshell]
                      @="extract"
                      [HKEY_CLASSES_ROOT7-Zip.cabshellextract]
                      @="Extract to Folder"
                      [HKEY_CLASSES_ROOT7-Zip.cabshellextractcommand]
                      @=""C:Program Files7-Zip7zG.exe" x "%1" -o*"
                      [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.cabshellopen]
                      @=""
                      [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.cabshellopencommand]
                      @=""C:Program Files7-Zip7zFM.exe" "%1""
                      [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.gz]
                      @="gz Archive"
                      [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.gzDefaultIcon]
                      @="C:Program Files7-Zip7z.dll,14"
                      [HKEY_CLASSES_ROOT7-Zip.gzshell]
                      @="extract"
                      [HKEY_CLASSES_ROOT7-Zip.gzshellextract]
                      @="Extract to Folder"
                      [HKEY_CLASSES_ROOT7-Zip.gzshellextractcommand]
                      @=""C:Program Files7-Zip7zG.exe" x "%1" -o*"
                      [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.gzshellopen]
                      @=""
                      [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.gzshellopencommand]
                      @=""C:Program Files7-Zip7zFM.exe" "%1""
                      [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.gzip]
                      @="gzip Archive"
                      [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.gzipDefaultIcon]
                      @="C:Program Files7-Zip7z.dll,14"
                      [HKEY_CLASSES_ROOT7-Zip.gzipshell]
                      @="extract"
                      [HKEY_CLASSES_ROOT7-Zip.gzipshellextract]
                      @="Extract to Folder"
                      [HKEY_CLASSES_ROOT7-Zip.gzipshellextractcommand]
                      @=""C:Program Files7-Zip7zG.exe" x "%1" -o*"
                      [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.gzipshellopen]
                      @=""
                      [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.gzipshellopencommand]
                      @=""C:Program Files7-Zip7zFM.exe" "%1""
                      [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.rar]
                      @="rar Archive"
                      [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.rarDefaultIcon]
                      @="C:Program Files7-Zip7z.dll,3"
                      [HKEY_CLASSES_ROOT7-Zip.rarshell]
                      @="extract"
                      [HKEY_CLASSES_ROOT7-Zip.rarshellextract]
                      @="Extract to Folder"
                      [HKEY_CLASSES_ROOT7-Zip.rarshellextractcommand]
                      @=""C:Program Files7-Zip7zG.exe" x "%1" -o*"
                      [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.rarshellopen]
                      @=""
                      [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.rarshellopencommand]
                      @=""C:Program Files7-Zip7zFM.exe" "%1""
                      [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.tar]
                      @="tar Archive"
                      [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.tarDefaultIcon]
                      @="C:Program Files7-Zip7z.dll,13"
                      [HKEY_CLASSES_ROOT7-Zip.tarshell]
                      @="extract"
                      [HKEY_CLASSES_ROOT7-Zip.tarshellextract]
                      @="Extract to Folder"
                      [HKEY_CLASSES_ROOT7-Zip.tarshellextractcommand]
                      @=""C:Program Files7-Zip7zG.exe" x "%1" -o*"
                      [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.tarshellopen]
                      @=""
                      [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.tarshellopencommand]
                      @=""C:Program Files7-Zip7zFM.exe" "%1""
                      [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.zip]
                      @="zip Archive"
                      [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.zipDefaultIcon]
                      @="C:Program Files7-Zip7z.dll,1"
                      [HKEY_CLASSES_ROOT7-Zip.zipshell]
                      @="extract"
                      [HKEY_CLASSES_ROOT7-Zip.zipshellextract]
                      @="Extract to Folder"
                      [HKEY_CLASSES_ROOT7-Zip.zipshellextractcommand]
                      @=""C:Program Files7-Zip7zG.exe" x "%1" -o*"
                      [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.zipshellopen]
                      @=""
                      [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.zipshellopencommand]
                      @=""C:Program Files7-Zip7zFM.exe" "%1""





                      share|improve this answer




























                        0














                        Here is a .reg file that configures Extract to folder as the default behavior when double-clicking files with one of the following extensions - 7z/CAB/GZ/GZIP/RAR/TAR/ZIP. You could do it for other file extensions using the same approach. I prefer the Windows default behavior for ISO/VHD mounting, so I didn't change that, and 7-Zip supports many other file types that I don't commonly encounter so I didn't change it for those.



                        You can revert this by going into 7-Zip File Manager, Tools, Options, and change the file associations as desired.



                        I tested on Windows 10 x64/7-Zip 15.12 x64. Because it uses C:Program Files for the path to 7-Zip, you definitely need x64 Windows + x64 7-Zip, but I only tested on Windows 10.



                        You will have the same right-click options as before, this only changes what happens when you double-click, and only for those seven file types (again, you could do this for other file types using the same approach).



                        If there is already a folder of that name, it will give you the same 7-Zip prompt you get normally, with options for Yes/Yes to All/Auto Rename/No/No to All.




                        Windows Registry Editor Version 5.00
                        [HKEY_CURRENT_USERSOFTWAREClasses.7z]
                        @="7-Zip.7z"
                        [HKEY_CURRENT_USERSOFTWAREClasses.cab]
                        @="7-Zip.cab"
                        [HKEY_CURRENT_USERSOFTWAREClasses.gz]
                        @="7-Zip.gz"
                        [HKEY_CURRENT_USERSOFTWAREClasses.gzip]
                        @="7-Zip.gzip"
                        [HKEY_CURRENT_USERSOFTWAREClasses.rar]
                        @="7-Zip.rar"
                        [HKEY_CURRENT_USERSOFTWAREClasses.tar]
                        @="7-Zip.tar"
                        [HKEY_CURRENT_USERSOFTWAREClasses.zip]
                        @="7-Zip.zip"
                        [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.7z]
                        @="7z Archive"
                        [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.7zDefaultIcon]
                        @="C:Program Files7-Zip7z.dll,0"
                        [HKEY_CLASSES_ROOT7-Zip.7zshell]
                        @="extract"
                        [HKEY_CLASSES_ROOT7-Zip.7zshellextract]
                        @="Extract to Folder"
                        [HKEY_CLASSES_ROOT7-Zip.7zshellextractcommand]
                        @=""C:Program Files7-Zip7zG.exe" x "%1" -o*"
                        [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.7zshellopen]
                        @=""
                        [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.7zshellopencommand]
                        @=""C:Program Files7-Zip7zFM.exe" "%1""
                        [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.cab]
                        @="cab Archive"
                        [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.cabDefaultIcon]
                        @="C:Program Files7-Zip7z.dll,7"
                        [HKEY_CLASSES_ROOT7-Zip.cabshell]
                        @="extract"
                        [HKEY_CLASSES_ROOT7-Zip.cabshellextract]
                        @="Extract to Folder"
                        [HKEY_CLASSES_ROOT7-Zip.cabshellextractcommand]
                        @=""C:Program Files7-Zip7zG.exe" x "%1" -o*"
                        [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.cabshellopen]
                        @=""
                        [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.cabshellopencommand]
                        @=""C:Program Files7-Zip7zFM.exe" "%1""
                        [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.gz]
                        @="gz Archive"
                        [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.gzDefaultIcon]
                        @="C:Program Files7-Zip7z.dll,14"
                        [HKEY_CLASSES_ROOT7-Zip.gzshell]
                        @="extract"
                        [HKEY_CLASSES_ROOT7-Zip.gzshellextract]
                        @="Extract to Folder"
                        [HKEY_CLASSES_ROOT7-Zip.gzshellextractcommand]
                        @=""C:Program Files7-Zip7zG.exe" x "%1" -o*"
                        [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.gzshellopen]
                        @=""
                        [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.gzshellopencommand]
                        @=""C:Program Files7-Zip7zFM.exe" "%1""
                        [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.gzip]
                        @="gzip Archive"
                        [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.gzipDefaultIcon]
                        @="C:Program Files7-Zip7z.dll,14"
                        [HKEY_CLASSES_ROOT7-Zip.gzipshell]
                        @="extract"
                        [HKEY_CLASSES_ROOT7-Zip.gzipshellextract]
                        @="Extract to Folder"
                        [HKEY_CLASSES_ROOT7-Zip.gzipshellextractcommand]
                        @=""C:Program Files7-Zip7zG.exe" x "%1" -o*"
                        [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.gzipshellopen]
                        @=""
                        [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.gzipshellopencommand]
                        @=""C:Program Files7-Zip7zFM.exe" "%1""
                        [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.rar]
                        @="rar Archive"
                        [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.rarDefaultIcon]
                        @="C:Program Files7-Zip7z.dll,3"
                        [HKEY_CLASSES_ROOT7-Zip.rarshell]
                        @="extract"
                        [HKEY_CLASSES_ROOT7-Zip.rarshellextract]
                        @="Extract to Folder"
                        [HKEY_CLASSES_ROOT7-Zip.rarshellextractcommand]
                        @=""C:Program Files7-Zip7zG.exe" x "%1" -o*"
                        [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.rarshellopen]
                        @=""
                        [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.rarshellopencommand]
                        @=""C:Program Files7-Zip7zFM.exe" "%1""
                        [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.tar]
                        @="tar Archive"
                        [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.tarDefaultIcon]
                        @="C:Program Files7-Zip7z.dll,13"
                        [HKEY_CLASSES_ROOT7-Zip.tarshell]
                        @="extract"
                        [HKEY_CLASSES_ROOT7-Zip.tarshellextract]
                        @="Extract to Folder"
                        [HKEY_CLASSES_ROOT7-Zip.tarshellextractcommand]
                        @=""C:Program Files7-Zip7zG.exe" x "%1" -o*"
                        [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.tarshellopen]
                        @=""
                        [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.tarshellopencommand]
                        @=""C:Program Files7-Zip7zFM.exe" "%1""
                        [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.zip]
                        @="zip Archive"
                        [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.zipDefaultIcon]
                        @="C:Program Files7-Zip7z.dll,1"
                        [HKEY_CLASSES_ROOT7-Zip.zipshell]
                        @="extract"
                        [HKEY_CLASSES_ROOT7-Zip.zipshellextract]
                        @="Extract to Folder"
                        [HKEY_CLASSES_ROOT7-Zip.zipshellextractcommand]
                        @=""C:Program Files7-Zip7zG.exe" x "%1" -o*"
                        [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.zipshellopen]
                        @=""
                        [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.zipshellopencommand]
                        @=""C:Program Files7-Zip7zFM.exe" "%1""





                        share|improve this answer


























                          0












                          0








                          0







                          Here is a .reg file that configures Extract to folder as the default behavior when double-clicking files with one of the following extensions - 7z/CAB/GZ/GZIP/RAR/TAR/ZIP. You could do it for other file extensions using the same approach. I prefer the Windows default behavior for ISO/VHD mounting, so I didn't change that, and 7-Zip supports many other file types that I don't commonly encounter so I didn't change it for those.



                          You can revert this by going into 7-Zip File Manager, Tools, Options, and change the file associations as desired.



                          I tested on Windows 10 x64/7-Zip 15.12 x64. Because it uses C:Program Files for the path to 7-Zip, you definitely need x64 Windows + x64 7-Zip, but I only tested on Windows 10.



                          You will have the same right-click options as before, this only changes what happens when you double-click, and only for those seven file types (again, you could do this for other file types using the same approach).



                          If there is already a folder of that name, it will give you the same 7-Zip prompt you get normally, with options for Yes/Yes to All/Auto Rename/No/No to All.




                          Windows Registry Editor Version 5.00
                          [HKEY_CURRENT_USERSOFTWAREClasses.7z]
                          @="7-Zip.7z"
                          [HKEY_CURRENT_USERSOFTWAREClasses.cab]
                          @="7-Zip.cab"
                          [HKEY_CURRENT_USERSOFTWAREClasses.gz]
                          @="7-Zip.gz"
                          [HKEY_CURRENT_USERSOFTWAREClasses.gzip]
                          @="7-Zip.gzip"
                          [HKEY_CURRENT_USERSOFTWAREClasses.rar]
                          @="7-Zip.rar"
                          [HKEY_CURRENT_USERSOFTWAREClasses.tar]
                          @="7-Zip.tar"
                          [HKEY_CURRENT_USERSOFTWAREClasses.zip]
                          @="7-Zip.zip"
                          [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.7z]
                          @="7z Archive"
                          [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.7zDefaultIcon]
                          @="C:Program Files7-Zip7z.dll,0"
                          [HKEY_CLASSES_ROOT7-Zip.7zshell]
                          @="extract"
                          [HKEY_CLASSES_ROOT7-Zip.7zshellextract]
                          @="Extract to Folder"
                          [HKEY_CLASSES_ROOT7-Zip.7zshellextractcommand]
                          @=""C:Program Files7-Zip7zG.exe" x "%1" -o*"
                          [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.7zshellopen]
                          @=""
                          [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.7zshellopencommand]
                          @=""C:Program Files7-Zip7zFM.exe" "%1""
                          [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.cab]
                          @="cab Archive"
                          [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.cabDefaultIcon]
                          @="C:Program Files7-Zip7z.dll,7"
                          [HKEY_CLASSES_ROOT7-Zip.cabshell]
                          @="extract"
                          [HKEY_CLASSES_ROOT7-Zip.cabshellextract]
                          @="Extract to Folder"
                          [HKEY_CLASSES_ROOT7-Zip.cabshellextractcommand]
                          @=""C:Program Files7-Zip7zG.exe" x "%1" -o*"
                          [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.cabshellopen]
                          @=""
                          [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.cabshellopencommand]
                          @=""C:Program Files7-Zip7zFM.exe" "%1""
                          [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.gz]
                          @="gz Archive"
                          [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.gzDefaultIcon]
                          @="C:Program Files7-Zip7z.dll,14"
                          [HKEY_CLASSES_ROOT7-Zip.gzshell]
                          @="extract"
                          [HKEY_CLASSES_ROOT7-Zip.gzshellextract]
                          @="Extract to Folder"
                          [HKEY_CLASSES_ROOT7-Zip.gzshellextractcommand]
                          @=""C:Program Files7-Zip7zG.exe" x "%1" -o*"
                          [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.gzshellopen]
                          @=""
                          [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.gzshellopencommand]
                          @=""C:Program Files7-Zip7zFM.exe" "%1""
                          [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.gzip]
                          @="gzip Archive"
                          [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.gzipDefaultIcon]
                          @="C:Program Files7-Zip7z.dll,14"
                          [HKEY_CLASSES_ROOT7-Zip.gzipshell]
                          @="extract"
                          [HKEY_CLASSES_ROOT7-Zip.gzipshellextract]
                          @="Extract to Folder"
                          [HKEY_CLASSES_ROOT7-Zip.gzipshellextractcommand]
                          @=""C:Program Files7-Zip7zG.exe" x "%1" -o*"
                          [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.gzipshellopen]
                          @=""
                          [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.gzipshellopencommand]
                          @=""C:Program Files7-Zip7zFM.exe" "%1""
                          [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.rar]
                          @="rar Archive"
                          [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.rarDefaultIcon]
                          @="C:Program Files7-Zip7z.dll,3"
                          [HKEY_CLASSES_ROOT7-Zip.rarshell]
                          @="extract"
                          [HKEY_CLASSES_ROOT7-Zip.rarshellextract]
                          @="Extract to Folder"
                          [HKEY_CLASSES_ROOT7-Zip.rarshellextractcommand]
                          @=""C:Program Files7-Zip7zG.exe" x "%1" -o*"
                          [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.rarshellopen]
                          @=""
                          [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.rarshellopencommand]
                          @=""C:Program Files7-Zip7zFM.exe" "%1""
                          [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.tar]
                          @="tar Archive"
                          [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.tarDefaultIcon]
                          @="C:Program Files7-Zip7z.dll,13"
                          [HKEY_CLASSES_ROOT7-Zip.tarshell]
                          @="extract"
                          [HKEY_CLASSES_ROOT7-Zip.tarshellextract]
                          @="Extract to Folder"
                          [HKEY_CLASSES_ROOT7-Zip.tarshellextractcommand]
                          @=""C:Program Files7-Zip7zG.exe" x "%1" -o*"
                          [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.tarshellopen]
                          @=""
                          [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.tarshellopencommand]
                          @=""C:Program Files7-Zip7zFM.exe" "%1""
                          [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.zip]
                          @="zip Archive"
                          [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.zipDefaultIcon]
                          @="C:Program Files7-Zip7z.dll,1"
                          [HKEY_CLASSES_ROOT7-Zip.zipshell]
                          @="extract"
                          [HKEY_CLASSES_ROOT7-Zip.zipshellextract]
                          @="Extract to Folder"
                          [HKEY_CLASSES_ROOT7-Zip.zipshellextractcommand]
                          @=""C:Program Files7-Zip7zG.exe" x "%1" -o*"
                          [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.zipshellopen]
                          @=""
                          [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.zipshellopencommand]
                          @=""C:Program Files7-Zip7zFM.exe" "%1""





                          share|improve this answer













                          Here is a .reg file that configures Extract to folder as the default behavior when double-clicking files with one of the following extensions - 7z/CAB/GZ/GZIP/RAR/TAR/ZIP. You could do it for other file extensions using the same approach. I prefer the Windows default behavior for ISO/VHD mounting, so I didn't change that, and 7-Zip supports many other file types that I don't commonly encounter so I didn't change it for those.



                          You can revert this by going into 7-Zip File Manager, Tools, Options, and change the file associations as desired.



                          I tested on Windows 10 x64/7-Zip 15.12 x64. Because it uses C:Program Files for the path to 7-Zip, you definitely need x64 Windows + x64 7-Zip, but I only tested on Windows 10.



                          You will have the same right-click options as before, this only changes what happens when you double-click, and only for those seven file types (again, you could do this for other file types using the same approach).



                          If there is already a folder of that name, it will give you the same 7-Zip prompt you get normally, with options for Yes/Yes to All/Auto Rename/No/No to All.




                          Windows Registry Editor Version 5.00
                          [HKEY_CURRENT_USERSOFTWAREClasses.7z]
                          @="7-Zip.7z"
                          [HKEY_CURRENT_USERSOFTWAREClasses.cab]
                          @="7-Zip.cab"
                          [HKEY_CURRENT_USERSOFTWAREClasses.gz]
                          @="7-Zip.gz"
                          [HKEY_CURRENT_USERSOFTWAREClasses.gzip]
                          @="7-Zip.gzip"
                          [HKEY_CURRENT_USERSOFTWAREClasses.rar]
                          @="7-Zip.rar"
                          [HKEY_CURRENT_USERSOFTWAREClasses.tar]
                          @="7-Zip.tar"
                          [HKEY_CURRENT_USERSOFTWAREClasses.zip]
                          @="7-Zip.zip"
                          [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.7z]
                          @="7z Archive"
                          [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.7zDefaultIcon]
                          @="C:Program Files7-Zip7z.dll,0"
                          [HKEY_CLASSES_ROOT7-Zip.7zshell]
                          @="extract"
                          [HKEY_CLASSES_ROOT7-Zip.7zshellextract]
                          @="Extract to Folder"
                          [HKEY_CLASSES_ROOT7-Zip.7zshellextractcommand]
                          @=""C:Program Files7-Zip7zG.exe" x "%1" -o*"
                          [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.7zshellopen]
                          @=""
                          [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.7zshellopencommand]
                          @=""C:Program Files7-Zip7zFM.exe" "%1""
                          [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.cab]
                          @="cab Archive"
                          [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.cabDefaultIcon]
                          @="C:Program Files7-Zip7z.dll,7"
                          [HKEY_CLASSES_ROOT7-Zip.cabshell]
                          @="extract"
                          [HKEY_CLASSES_ROOT7-Zip.cabshellextract]
                          @="Extract to Folder"
                          [HKEY_CLASSES_ROOT7-Zip.cabshellextractcommand]
                          @=""C:Program Files7-Zip7zG.exe" x "%1" -o*"
                          [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.cabshellopen]
                          @=""
                          [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.cabshellopencommand]
                          @=""C:Program Files7-Zip7zFM.exe" "%1""
                          [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.gz]
                          @="gz Archive"
                          [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.gzDefaultIcon]
                          @="C:Program Files7-Zip7z.dll,14"
                          [HKEY_CLASSES_ROOT7-Zip.gzshell]
                          @="extract"
                          [HKEY_CLASSES_ROOT7-Zip.gzshellextract]
                          @="Extract to Folder"
                          [HKEY_CLASSES_ROOT7-Zip.gzshellextractcommand]
                          @=""C:Program Files7-Zip7zG.exe" x "%1" -o*"
                          [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.gzshellopen]
                          @=""
                          [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.gzshellopencommand]
                          @=""C:Program Files7-Zip7zFM.exe" "%1""
                          [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.gzip]
                          @="gzip Archive"
                          [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.gzipDefaultIcon]
                          @="C:Program Files7-Zip7z.dll,14"
                          [HKEY_CLASSES_ROOT7-Zip.gzipshell]
                          @="extract"
                          [HKEY_CLASSES_ROOT7-Zip.gzipshellextract]
                          @="Extract to Folder"
                          [HKEY_CLASSES_ROOT7-Zip.gzipshellextractcommand]
                          @=""C:Program Files7-Zip7zG.exe" x "%1" -o*"
                          [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.gzipshellopen]
                          @=""
                          [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.gzipshellopencommand]
                          @=""C:Program Files7-Zip7zFM.exe" "%1""
                          [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.rar]
                          @="rar Archive"
                          [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.rarDefaultIcon]
                          @="C:Program Files7-Zip7z.dll,3"
                          [HKEY_CLASSES_ROOT7-Zip.rarshell]
                          @="extract"
                          [HKEY_CLASSES_ROOT7-Zip.rarshellextract]
                          @="Extract to Folder"
                          [HKEY_CLASSES_ROOT7-Zip.rarshellextractcommand]
                          @=""C:Program Files7-Zip7zG.exe" x "%1" -o*"
                          [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.rarshellopen]
                          @=""
                          [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.rarshellopencommand]
                          @=""C:Program Files7-Zip7zFM.exe" "%1""
                          [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.tar]
                          @="tar Archive"
                          [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.tarDefaultIcon]
                          @="C:Program Files7-Zip7z.dll,13"
                          [HKEY_CLASSES_ROOT7-Zip.tarshell]
                          @="extract"
                          [HKEY_CLASSES_ROOT7-Zip.tarshellextract]
                          @="Extract to Folder"
                          [HKEY_CLASSES_ROOT7-Zip.tarshellextractcommand]
                          @=""C:Program Files7-Zip7zG.exe" x "%1" -o*"
                          [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.tarshellopen]
                          @=""
                          [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.tarshellopencommand]
                          @=""C:Program Files7-Zip7zFM.exe" "%1""
                          [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.zip]
                          @="zip Archive"
                          [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.zipDefaultIcon]
                          @="C:Program Files7-Zip7z.dll,1"
                          [HKEY_CLASSES_ROOT7-Zip.zipshell]
                          @="extract"
                          [HKEY_CLASSES_ROOT7-Zip.zipshellextract]
                          @="Extract to Folder"
                          [HKEY_CLASSES_ROOT7-Zip.zipshellextractcommand]
                          @=""C:Program Files7-Zip7zG.exe" x "%1" -o*"
                          [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.zipshellopen]
                          @=""
                          [HKEY_CURRENT_USERSOFTWAREClasses7-Zip.zipshellopencommand]
                          @=""C:Program Files7-Zip7zFM.exe" "%1""






                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Dec 4 '15 at 20:13









                          CraigCraig

                          40436




                          40436

















                              protected by Community Aug 29 '15 at 22:30



                              Thank you for your interest in this question.
                              Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).



                              Would you like to answer one of these unanswered questions instead?



                              Popular posts from this blog

                              "Incorrect syntax near the keyword 'ON'. (on update cascade, on delete cascade,)

                              Alcedinidae

                              Origin of the phrase “under your belt”?