WinZip, 7zip, Winrar Command Line to Compress structure of folders

archivecompressionrar

I have a Windows Server 2008R2 which has a massive file share of Video files, I need to run a zip command line in a batch script which will :

a) Compress / zip each video file inside each folder with the respective filename
b) then compress / zip each folder with its respective name
c) Retain the original folder structure
d) then zip the whole structure into one single zip file containing the whole folder structure and video zip files inside it.

is this even possible ? Can I use any of the above programs via command line to batch / powershell it ?

The server has 8GB RAM with a Core i3 Processor.

Will be grateful for your suggestions and help

Best Answer

Assume the directory name is \video .
Create a batch file with the following lines:

for /r \video %%a in (.) do @zip.exe -m "%%~pa\video" "%%~pa\*"
zip.exe -m -r Allvideo "\video\*"

This will create a final archive called allvideo.zip with a directory structure mirroring \video. Where video files once resided, video.zip will be found.

For this example I used the Zip utility found at: http://www.info-zip.org/Zip.html

Your server has enough horsepower for this activity, but, you may need to watch disk space. I'm only able to get ~5% size reduction by compressing a video file.