I am trying to write a batch script that will run automatically compressing subdirectories using winrar or 7-zip:
Example:
My Pictures
Pics1 (Pics1.
Here's how to do it in 7-zip.
Let's assume your files are in folder C:\Pictures\
. Then you can use the following batch command to create multiple archives with the same name as your directories.
FOR /D %%i IN (c:\Pictures\*.*) DO "c:\Program Files\7-Zip\7z.exe" a "%%i.zip" "%%i\"
This will compress each folder in the directory Pictures
. Change c:\Pictures
to the directory containing your folders. If 7-zip is installed to a different directory, change the "c:\Program Files\7-Zip\7z.exe"
to a directory where 7-zip is installed.