0

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

user9517
  • 117,122
Mutahir
  • 2,377

2 Answers2

2

7zip comes with 7z.exe which can be used on the command line or in scripts. However, you'll have to use a script to do the folder structure zipping that you want. I've done something similar, zipping log files by month then year. It's not pretty, but I can post the script if you'd like to see it.

Jim G.
  • 2,707
0

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.

RobW
  • 2,816