For Programmers: Free Programming Magazines  


Home > Archive > Compression > January 2006 > Re-compressing existing 7zip archives ...









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re-compressing existing 7zip archives ...
lasitter

2006-01-22, 3:55 am

I'd like to be able to do fast compression with 7Zip during the work
day, and then tell 7Zip to re-compress what's in the archive to the
highest level (for the selected format, or .7z as a default) at night,
when the added time required doesn't matter.

I'd want it to use the file as it exists in the archive, so I guess
that would mean extracting and re-compressing the file(s) in the
archive that were not already at the highest level.

I've overlooked the simple switch or command that does this with 7Zip.
Could anyone point it out to me? I'd like it to be smart enough to
skip archives that had already been compressed to the "ultra" level.

Thanks.

johan.debock@gmail.com

2006-01-29, 6:55 pm

for /r %%i in (*.%1) do call 7zconvert "%%i"
dir /s ERROR

7zconvert.bat:
C:\"Program Files"\7-Zip\7z.exe x -o"%~dpn1" "%~dpnx1" *
if ERRORLEVEL 1 rename "%~dpnx1" "%~dpnx1"ERROR
del "%~dpnx1"
C:\"Program Files"\7-Zip\7z.exe a -r -mx9 "%~dpn1".7z "%~dpn1"\*
if ERRORLEVEL 1 rename "%~dpn1" "%~dpn1"ERROR
rmdir /s /q "%~dpn1"

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com