I am trying to write a batch script that will run automatically compressing subdirectories using winrar or 7-zip:
Example:
My Pictures
Pics1 (Pics1.
Thank you for the great script, I just had 3 issues/changes - directory names with space in name were not working, I just wanted to backup level 1 subdirectories and I wanted to pack all the subdirectories in the current directory (it's great for quick backup of all subdirectories separately). Here is the modification if you need something similar:
set zip="C:\Program Files\WinRAR\rar.exe" a -r -u -df
dir /b /o:n /ad > .\folders.txt
for /F "tokens=*" %%A in (.\folders.txt) do if not exist ".\%%~nA.rar" %zip% ".\%%~nA.rar" "%%A"