Advertisement
jitteryjim

Andrew Armstrong's CBR to CBZ

Aug 13th, 2021
10
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. @ECHO OFF
  2. REM Based on
  3. REM Mass Zip, RAR to 7Zip Recompression Batch File by Andrew Armstrong
  4. REM http://aarmstrong.org/tutorials/mass-zip-rar-to-7zip-recompression-batch-file
  5. REM
  6. REM Find all .cbr and .rar files in the current directory, recompress them into .cbz and .zip files - but do not delete the originals.
  7.  
  8. ECHO Searching for CBR and RAR files to recompress into CBZ (Comic Book Zip) archives.
  9.  
  10. for %%F in (*.cbr *.rar) do (
  11. ECHO Found %%F to recompress...
  12. REM Extract...
  13. "C:\Program Files\7-zip\7z" x "%%F" -o"%%F contents"
  14. REM Does the directory exist? has 7zip created it correctly?
  15. IF EXIST "%%F contents" (
  16. REM Change directory, create zip of contents of directory...
  17. CD "%%F contents"
  18. REM remove banners
  19. DEL /F /S /Q z*.*
  20. REM Delete Thumbnail files.
  21. DEL /F /S /Q Thumbs.db
  22. REM compression level is 0, store only.
  23. "C:\Program Files\7-zip\7z" a -tzip "../%%~nF.cbz" * -mx=0
  24. CD ..
  25. REM Delete the temporary extraction folder
  26. RMDIR "%%F contents" /S /Q
  27. ECHO Recompressed %%F to %%~nF.zip
  28. )
  29. )
  30. ECHO Search ended.
  31.  
  32. PAUSE
  33. CLS
  34. EXIT
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement