Link to home
Start Free TrialLog in
Avatar of Tek Info
Tek Info

asked on

Zip command line program

I would like to use a script to effectively copy data from one computer to a server, create a zip file, and password protected.
What would you suggest?
Avatar of NVIT
Flag of United States of America image

7-Zip is free and has command line options, including password
I would suggest to create the Zip on the computer and copy only the Zip to server.
Copying single files over network needs extra step to check whether one single file failed to be copied.
Also the one big block is better and faster copied then multiple small files.

Avatar of Bill Prew
Bill Prew

7-Zip is definitely the best free tool for this.  There are lots of examples here on Experts Exchange showing how to use it in scripting situations, mostly BAT, but some VBS and PS1 too.

As mentioned compressing on the client will reduce the size of the data that you have to send to the server and perhaps speed up the process.  Although naturally creating the ZIP file take some time too on the client to do the compression.

Is this just for backup purposes, or will you be unzipping it as soon as it gets oto the server?

Compress-Archive is the built-in PowerShell cmdlet for this need. PS v3 and above, no third-party install required.
Avatar of Dr. Klahn
Dr. Klahn

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Echo echo echo...

I recommend 7ZIP instead - it's free and open source.  Examples can be found here:
Need more details:
  • Detailed info about files to be zipped, all in one folders or several? subfolders? selected extensions or all?
  • What zip utility do you want to use?
  • Where will file be placed?
  • Will password be in the BAT file, hard coded?
  • Should the zip, or files be deleted afterwards?
  • . . .