7 zip: change to extract on double-click

allelopath
allelopath used Ask the Experts™
on
How can change 7-zip so that when a zip file is double-clicked, it extracts that file?
I've associated zip files with 7-zip, but this results in it opening in archive folder on a double-click. I've tried all 3 executables in the 7-zip program files directory.

Running Windows 7, obviously
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
I could be incorrect but I believe this is only possible with selfextracting archives which need to be created as such.
Raymond PengSystems Engineer
Commented:
Not possible - it needs to know by default where it's going to save the files to a folder.  Hence the right click > extract to or double click then Extract from top menu

As previous poster stated unless they created an Archive executable that tells it where to extract (ex. temp folder).
Top Expert 2013
Commented:
look if turning it into an exe file helps :  http://www.gdgsoft.com/faq/7zsfx.htm
Bootstrap 4: Exploring New Features

Learn how to use and navigate the new features included in Bootstrap 4, the most popular HTML, CSS, and JavaScript framework for developing responsive, mobile-first websites.

Top Expert 2013

Commented:
i would like to know if my post helped or not
plse give feedback !

Commented:
Here's a simple batch file you can use.  There's no error checking or anything like that.  It just passes the file name and location to 7z for extraction.

With your favourite text editor, save the following code as a .cmd file in a folder inside your path statement.  C:\Windows is the easiest.  If you use notepad, make sure it saves the file with .cmd and not .cmd.txt.

@echo off
"C:\Program Files\7-Zip\7zG.exe" x "%~f1" -o"%~dp1%~n1"

Open in new window


Verify the correct path to your 7zG.exe.  Change it as needed.  Be sure, though, you maintain the "" around the exe location.

Then right-click on a 7Zip archive and select "Open With" then select "Choose Program".  Select "Browse".  Then navigate to the folder where you save the cmd file and select it and click "Open".  Be sure to check the box next to "Always use the selected program to open this kind of file."
Top Expert 2013

Commented:
hey ltam, does that work also for winzip files, if the path is changed to winzip ?

Commented:
Winzip has it's own command line options.  The simplest way would be to just associate the archives you want to extract on double-click with that cmd file and 7Zip will extract it.

Or you could try something like this:

@echo off
if /i %~x1 == .7z "C:\Program Files\7-Zip\7zG.exe" x "%~f1" -o"%~dp1%~n1"
if /i %~x1 == .zip "C:\Program Files\WinZip\WINZIP32.EXE" -e "%~f1" "%~dp1%~n1"

Open in new window


This will execute 7Zip for all .7z files and winzip for all .zip files.  With the variety of archive names, I think just associating them all with the simple batch file is the easiest.  I believe 7Zip handles just about every archive out there.

Winzip has an add-on for command line functionality, but I've been able to pass commands to the executable without the module installed.  I also think the command line add-on doesn't work with the evaluation version.

As for winrar, I haven't worked with it on a command-line at all, so I'd have to do some hunting for syntax and such.
Top Expert 2013

Commented:
tx for the info - appreciated!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial