Batch repacking zip archives into 7z
Solution 1:
This is my own take on the problem:
for %%F in (*.zip) do ( "C:\Program Files\7-Zip\7z.exe" x -y -o"%%F_tmp" "%%F" * & pushd %%F_tmp & "C:\Program Files\7-Zip\7z.exe" a -y -r -t7z ..\"%%~nF".7z * & popd & rmdir /s /q "%%F_tmp" )
Save this to a zip to 7z.bat
file, place it into the directory with all the zip files you want to convert and double-click it there.
Thanks to Clint Priest for the base code.
Solution 2:
You can use the 7zip command line (detailed examples here) to first extract all files/folders (using the e
command) and then re-compress them to 7z (using the a
command).
If you plan on repeating this operation, consider capturing the command lines in a .bat/.cmd file.
And always test on a small directory before trying on a huge number of archives!