Peter Wilcox
asked on
Extract all zip files in a specific folder
Is there a way to extract zip files in folder a folder automatically with out having to hard code each zip file? Each of the zip file has password also to it.
What zip software are you using?
you can use winzip at the commandline. so a batch solution is possible
Sara
@echo off
for /f "delims=" %%i in ('dir /b *.zip') do winzip -e "%%i" "%%~nI" -sPaSsWoRd
if each file has a different password you would need to call a second batch in the for loop (or a console program you provide) which is able to add the password to each file passed.Sara
Are the passwords all the same, or unique to each file? If all the same then it's doable, if different then it seems like you'd have to do single file sensitive processing so you knew which password to use.
~bp
~bp
ASKER
They are the same ...
Is the target location for the extracted files the same for all zips, if so then you should be able to just use a wildcard filter on the zip command line, like:
7z x *.zip -psecret -oc:\temp
~bp
7z x *.zip -psecret -oc:\temp
~bp
the batch file i posted would create a folder of same name as the zip file.
if you don't like the password to be stored in a batchfile you could pass it as argument instead.
then the for statement would change to
Sara
if you don't like the password to be stored in a batchfile you could pass it as argument instead.
then the for statement would change to
for /f "delims=" %%i in ('dir /b *.zip') do winzip -e "%%i" "%%~nI" -s%1
Sara
ASKER
Sara & Billprew,
Yes I would like the data extracted from all into one specfic folder.
Yes I would like the data extracted from all into one specfic folder.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
==> Yes I would like the data extracted from all into one specfic folder.
Okay, 7z with wildcards would work as I mentioned above then.
~bp
Okay, 7z with wildcards would work as I mentioned above then.
~bp
ASKER
I own winzip...
i checked winzip on my notebook and found out that it is winzip32 and not only winzip.
try to start winzip32 from command line. type
winzip32 /?
and if that works also the for statement should work.
if you get an error you need to use the full path to winzp32.
assuming it is installed at c drive then do
c:
cd \
dir /s winzip*.exe
that should give you the path to winzip32.exe.
Sara
try to start winzip32 from command line. type
winzip32 /?
and if that works also the for statement should work.
if you get an error you need to use the full path to winzp32.
assuming it is installed at c drive then do
c:
cd \
dir /s winzip*.exe
that should give you the path to winzip32.exe.
Sara
For winzip you actually want to get the command line addon (free to licensed owners) and use that from BAT files.
http://www.winzip.com/prodpagecl.htm
~bp
http://www.winzip.com/prodpagecl.htm
~bp
my winzip32.exe works from commandline. i didn't install an add-on for that.
Sara
Sara
ASKER
I already know the full path to winzip command line:
"C:\Program Files\WinZip\wzunzip.exe"
"C:\Program Files\WinZip\wzunzip.exe"
Then it should be as simple as:
"C:\Program Files\WinZip\wzunzip.exe" c:\fromdir\*.zip c:\destdir
~bp
"C:\Program Files\WinZip\wzunzip.exe" c:\fromdir\*.zip c:\destdir
~bp
ASKER
Billprew where should I add the password part since these zip files have passwords in them.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Also, fyi, if you do WZUNZIP at a command line with noting else it will open the help file where the various command line options are discussed.
~bp
~bp