Does WinZip support command line parameters?
I have WinZip v11.2 and I needed to use WinZip from inside a batch file to extract some files. Going to the WinZip website, they want me to upgrade to a new version of WinZip for $30 so that I can get the free command line interface. What??? I don’t need any of the new features that they offer with the newer version. So I attempted to run it from the command line and tried several variations of specifying flags and received an error: “The command line option used is unsupported by WinZip.”
Ok it might just be there… Searching the internet I found some information in a couple of places, I hope you find this summary useful:
Please note, I have only tried this with WinZip v11.2 (SR-1) – Your Mileage May Vary [YMMV]
Extracting Files: -e
The command format is:
winzip32 [–min] -e [options] filename[.zip] folder
where:
- -min will start it in a minimized window. If used, it must be the first option.
- -e Extract files
- -j do not use folder names
- -o Overwrite existing files without prompting and “Junk pathnames”, respectively.
- -s Password if it is required. Passwords are case-sensitive. You can use quotes if desired either of the following is acceptable:
- -sPASSWORD -or-
-s”Really loooooong Password with embedded spaces“ - filename.zip
- Specifies the name of the Zip file involved; specify the full filename (including the folder).
- folder folder name to which the files are extracted. If the folder does not exist it is created.
Adding Files
The command format is:
winzip32 [-min] action [options] filename[.zip] files
where:
- -min will start it in a minimized window. If used, it must be the first option.
- action -a for add, -f for freshen, -u for update, and -m for move. You must specify one, and only one, of these actions.
options
- -r corresponds to the Include subfolders checkbox in the Add dialog and causes WinZip to add files from subfolders. Folder information is stored for files added from subfolders.
- -p WinZip will store folder information for all files added, not just for files from subfolders; the folder information will begin with the folder specified on the command line.
- -ex, -en, -ef, -es, and -e0 determine the compression method: eXtra, Normal (default), Fast, Super fast, and no compression.
- -hs includes hidden and system files.
- -sPassword is used to specify a case-sensitive password. The password can be enclosed in quotes, for example, -s”Really long Password with embedded spaces”.
- filename.zip Specifies the name of the Zip file involved. Use the full filename (including the folder).
- files Is a list of one or more files, or the @ character followed by the filename containing a list of files to add, one filename per line. Wildcards (e.g. *.doc) are allowed.
Notes
• IMPORTANT: always specify complete filenames, including the drive and full folder name for all files.
• To run WinZip minimized use the “-min” option. If specified, this option must be first.
• Enclose long filenames in quotes.
• When using a list (“@”) file, no leading or trailing spaces should appear in file IDs in the list.
• The action and any options must be separated by at least one space.