I'm running Windows 10, however I'll need it to work on Windows 7 as well.
file.zip which contains
x zip files within it, each of which also contain
x zip files. How would I be able to extract all of these "not manually"? I.E. with a bach file or a python script?
Below is a method I've used in the past for the same type of task that you describe which I pulled from one of my "bag of scripts". I used the free 7-Zip application for this task with 100% success.
Essentially this . . .
- Uses the 7-Zip (7za) app to extract zip file(s) contents in one location to another
- Then it does an xcopy of extracted ZIP files within the initial extracted files and copies those to a working directory
- Then it deletes ZIP files from source, and extracts the other zip files from working directory and loops until complete
Note: The 7za executable file may either need to be copied to the
/system32 folder or you may need to set the path it resides into the
PATH environment variable.
You will need to set the source, destination, and working directory variable values accordingly for your environment and needs only and the rest should just work as expected.
@ECHO ON SET sourcedir=C:\Test\Source SET destdir=C:\Test\Dest SET workdir=C:\Test\WorkTemp :unzip 7za -Y e "%sourcedir%" -o"%destdir%" -r DEL /Q /F "%workdir%\*zip XCOPY /Y /F %destdir%\*.zip "%workdir%" DEL /Q /F %destdir%\*.zip DIR "%workdir%\*.zip" /A-D IF ERRORLEVEL 1 GOTO :done :unzip2 7za -Y e "%workdir%" -o"%destdir%" -r DEL /Q /F "%workdir%\*.zip" XCOPY /Y /F %destdir%\*.zip "%workdir%" DEL /Q /F %destdir%\*.zip DIR "%workdir%\*.zip" /A-D IF ERRORLEVEL 1 GOTO :done GOTO :unzip2 :done GOTO :EOF