2

I have a zip file results.zip. It contains two folders that contain a bunch of zip files -- PASS/test1.zip, FAIL/test2.zip, FAIL/test3.zip.

On linux it is trivial to unzip these in a couple of steps:

$ unzip results.zip
$ echo FAIL/*.zip PASS/*.zip | xargs -n1 unzip

Some windows users complain that it is cumbersome to unzip all the files on windows. (There are dozens of zips inside the main zip.) Is there a mechanism that would allow them to expand the contents of all of the files at once?

Some customer boxes are newer, but there are many that are still using WinXP.

4 Answers 4

1

Give them unzip.exe and a batch script like

unzip results.zip
for %%i in (FAIL\*.zip PASS\*.zip) do unzip %%i
1
0

Try ExtractNow. I haven't tested this feature myself, but it does claim to support it.

0

Here is a solution for windows assuming 7zip is installed in the default location.

@echo off
Setlocal EnableDelayedExpansion
Set source=%1
Set SELF=%~dpnx0
For %%Z in (!source!) do (
    set FILENAME=%%~nxZ
)
set FILENAME=%FILENAME:"=%
"%PROGRAMFILES%\7-zip\7z.exe" x -o* -y "%FILENAME%"
rem DEL "%FILENAME%"
For %%Z in (!source!) do (
    set FILENAME=%%~nZ
)
for %%a in (zip rar jar z bz2 gz gzip tgz tar lha iso wim cab rpm deb) do (
    
    forfiles /P ^"%FILENAME%^" /S /M *.%%a /C "cmd /c if @isdir==FALSE \"%SELF%\" @path"
)

This has been adapted from here https://social.technet.microsoft.com/Forums/ie/en-US/ccd7172b-85e3-4b4a-ad93-5902e0abd903/batch-file-extracting-all-files-from-nested-archives?forum=ITCG

Notes:

  1. The only way to do variable modification using the ~ modifiers is to use a dummy for..in loop. If there is a better way please edit.
  2. ~nx modifies the variable to make it a full path+file name.
  3. ~dpnx also does the same thing to %0 i.e. gets the full path and filename of the script.
  4. -o* in the 7zip command line allows 7zip to create folder names without the .zip extension like it does when extracting with a right click in the gui.
  5. ~n modifies the variable to make it a filename without an extension. i.e. drops the .zip
  6. Note that the escape character (for quotes) in FORFILES /P is ^ (caret) while for the CMD /C it is \. This ensures that it handles path and filenames with spaces also recursively without any problem.
  7. You can remove the REM from the DEL statement if you want the zip file to be deleted after unzipping.
-1

See this

http://www.softpedia.com/get/Compression-tools/Multi-Unpacker.shtml

"Nested archive handling (recursively extract archives that were packed in other archives)."

OS: Windows 2K / XP / 2003 / Vista

1
  • 1
    This appears to be nonfunctional. Pointed it at a folder with a zip archive as described above (with ~60 archives inside), and it says it extracted 2 archives. No output seen on the disk.
    – bstpierre
    Oct 27, 2010 at 1:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .