button to extract 7z zip to current dir

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
darren1234
Junior Member
Junior Member
Posts: 42
Joined: 2017-09-21, 10:35 UTC

button to extract 7z zip to current dir

Post by *darren1234 »

I have done the following for a button to extract selected archive to current dir using 7z:

command : "C:\Program Files\7-Zip\7zG.exe"
parameters : e %P%N -o%P%O
start path : %P


It works, but when used it displays a 'confirm file replace' dialogue.
Is there a better way to do the same thing ?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: button to extract 7z zip to current dir

Post by *ghisler(Author) »

According to a quick Google search, 7zg.exe accepts the following parameters to control overwrite behaviour:
-aoa Overwrite All existing files without prompt.
-aos Skip extracting of existing files.
-aou Auto rename extracting file (for example, name.txt will be renamed to name_1.txt).
-aot Quto rename existing file (for example, name.txt will be renamed to name_1.txt).
Author of Total Commander
https://www.ghisler.com
darren1234
Junior Member
Junior Member
Posts: 42
Joined: 2017-09-21, 10:35 UTC

Re: button to extract 7z zip to current dir

Post by *darren1234 »

Thanks for pointing me in the right direction. I found the problem, if the archive contained folders with same name files in (like /Windows8 version and /Windows7 version, etc.) my command would extract all the files in all the folders to the root folder in the excracted folder, creating a name conflict.
I found a fix, as follows :
command : "C:\Program Files\7-Zip\7zG.exe"
parameters : x %P%N -o%P%O
start path : %P
User avatar
tuska
Power Member
Power Member
Posts: 3760
Joined: 2007-05-21, 12:17 UTC

Re: button to extract 7z zip to current dir

Post by *tuska »

Post Reply