Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Shell 

Turn zip & rar to 7z files

This one is quick & easy, what it does find all .zip and .rar files in the current directory, recompress them into 7zip files and delete the originals.

Source
Code
@ECHO OFF
REM zip_to_7zip_automated_delete.bat - find all .zip and .rar files in the current directory, recompress them into 7zip files and delete the originals. Skip ones that don't decompress.
    
ECHO Searching for RAR and ZIP files to recompress into 7zip archives.
for %%F in (*.rar *.zip) do (
ECHO Found %%F to recompress...
REM Extract...
"C:\Program Files\7-Zip\7z" x "%%F" -o"%%F contents"
REM Does the directory exist? has 7zip created it correctly?
IF EXIST "%%F contents" (
REM Change directory, create 7zip of contents of directory...
CD "%%F contents"
"C:\Program Files\7-Zip\7z" a -t7z "../%%~nF.7z" * -mx=9 0=bcj2 1=LZMA2:d128m:pb2:lp0:lc4:fb175 2=LZMA2:d19:pb2:lp0:lc4:fb175 3=LZMA2:d19:pb2:lp0:lc4:fb175 b0:1 b0s1:2 b0s2:3
CD ..
REM Delete the old files
DEL "%%F" /F /Q
RMDIR "%%F contents" /S /Q
ECHO Recompressed %%F to %%~nF.7z and deleted %%F.
)
)
ECHO Search ended.
    
pause
Nice, make sure to have all the programs installed and path set correctly
not working for me ...directory is correct but due to additional programs i think not working...lol
Very nice code ,
Can i chage it to tar to ?
Thanks for posting


Possibly Related Threads...
Thread / Author Replies Views Last Post
by sundaranSep 24, 2026 09:36 AM 1 97 Sep 24, 2026 09:36 AM
Last Post: Anonynuk
by sundaranSep 19, 2026 10:04 PM 0 102 Sep 19, 2026 10:04 PM
Last Post: sundaran
[Shell] by mralihaiderAug 6, 2017 11:39 AM 7 362 Aug 6, 2017 11:39 AM
Last Post: GoDZMoDZ