Skip to content

Instantly share code, notes, and snippets.

@HakamRaza
Last active March 12, 2022 14:26
Show Gist options
  • Save HakamRaza/0a6c555b39a02ea4112d8817b029fdd1 to your computer and use it in GitHub Desktop.
Save HakamRaza/0a6c555b39a02ea4112d8817b029fdd1 to your computer and use it in GitHub Desktop.
:: This is to .cbz archive 2 level deep folder containing images using WinRar CLI
:: Resulted Rar archieve then will be change format from .rar to .cbz
:: Archieved directory is removed by -dr flag
:: "C:\Program Files\WinRAR\RaR" is the installed WinRar Rar.exe directory
:: Use - Place this file at selected directory and run script.
FOR /d %%x IN (*.*) DO (
cd "%%x" && (
FOR /d %%y IN (*.*) DO (
"C:\Program Files\WinRAR\RaR" a -dr "%%y".rar "%%y"
) && (
ren *.rar *.cbz
)
) && cd ..
)
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment