Académique Documents
Professionnel Documents
Culture Documents
Page1 of 2
Requirements
The WinZip Command Line Support Add-On requires WinZip 8.0 or higher, and Windows 95, Windows 98, Windows NT, Windows 2000, Windows Me, or Windows XP. If you are using an earlier registered version of WinZip, please download and install the free upgrade to WinZip 8.1 before installing the WinZip Command Line Support Add-On. If you are using an earlier evaluation version of WinZip, please download and install the current evaluation version.
License
The complete license agreement for this software is available on the page WinZip Command Line Support Add-On License Agreement. http://www.winzip.com/wzcline.htm 10/07/2003
WinZip Command Line Support Add-On Webmasters, please note this distribution restriction: Unless you have prior written authorization from WinZip Computing, Inc., you are not authorized to distribute copies of this add-on. Please refer anyone interested in the add-on to the WinZip web site to be sure they get the most recent version.
Page2 of 2
Return to WinZip Home Page Basic WinZip Information | What's New | Search | Order Now Download Evaluation Version | Download Upgrade | Other Downloads WinZip Self-Extractor | Beta Page | Mailing List FAQs | Support
http://www.winzip.com/wzcline.htm
10/07/2003
Overview
The WinZip Command Line Support Add-On lets you use WinZip's power from batch files, macros, and other situations when you have a specific task and would prefer to accomplish it quickly or automatically, without using the usual WinZip graphical user interface. Two executable files implement the WinZip Command Line Support Add-On: WZZIP.EXE (for zipping) and WZUNZIP.EXE (for unzipping). This help file describes how to use WZZIP and WZUNZIP. It includes sections on Using WZUNZIP and Using WZZIP plus comprehensive reference sections listing all commands and options in alphabetical order. The two reference sections are directly accessible for browsing as the WZUNZIP reference and WZZIP reference. See also the sections on Copyright, License, Warranty and Technical Support.
The exact format of the command depends on which of these you use.
(For information on the PATH environment variable, please refer to your Windows documentation. If you use this method regularly, you will probably want to edit AUTOEXEC.BAT so that the WinZip folder is permanently added to the PATH environment variable.)
Using WZZIP
The general syntax for WZZIP is: wzzip [options] zipfile [@listfile] [files...] Elements in [brackets] are optional. The options specify what you want WZZIP to do and how to do it. Options are listed individually in the separate WZZIP reference section, but here is some general information: Options are introduced by either a hyphen ["-r"] or a forward slash ["/r"]. Multiple options must be separated by one or more spaces ("-r -p", not "-r-p"). If you don't specify any options, WZZIP assumes -a (Add files).
zipfile is the name of the Zip file you want to work with. You may specify a drive and/or folder. If you don't provide a filename extension, WZZIP adds ".zip". You can specify a different extension, but doing so may prevent WinZip and other Windows Zip products from operating correctly with the Zip file. If no Zip file exists with the name you specify, WZZIP will create the file. @listfile is the name of a text file that contains a list of the files to be added to the Zip file. Each line of the listfile can contain one filename. This may include a drive letter and full or partial path. If no drive letter is provided, the current drive is assumed. If no path is provided, the current directory in the specified or current drive is assumed. If a partial path is provided, it is assumed to be relative to the current directory of the specified or current drive. Filenames may also include wildcards. The wildcard specification "*" is assumed to mean "*.*", i.e., all files. The wildcard specification "*." means "all files that have no extension." Filenames containing spaces may be quoted, but this is not required in a listfile. Listfiles can also contain comments: any text following a semicolon (';') is ignored, up to the end of the line. Here is an example of the contents of a listfile: ; List of files to zip info.doc *.txt ; Zip up all .txt files files is a literally-specified list of one or more files to be added to the Zip file. Filename specifications follow the same rules as for listfiles (above), except that filenames containing spaces must be enclosed in double quotes. Unless -d (delete files) is specified, WZZIP assumes "*.*" (i.e., all files) if you don't specify either @listfile or files. The -d action requires you to specify files explicitly.
Examples
wzzip test.zip Adds all files in the current folder to the Zip file Test.zip (*.* assumed). wzzip test.zip *.* Adds all files in the current folder to the Zip file Test.zip. wzzip test.zip *.txt Adds all files with a TXT extension to the Zip file Test.zip. wzzip test.zip abc.txt def.txt Adds ABC.TXT and DEF.TXT to Test.zip. wzzip -xABC.TXT test.zip *.txt
Adds all files with a TXT extension to Test.zip except ABC.TXT. wzzip -rp test.zip d:\docs\*.txt Adds to the Zip all files with a .txt extension in D:\Docs and all of its subfolders. The path relative to D:\Docs is stored for all files. wzzip -u test.zip @Zipit.lst Updates all files whose names are in the text file Zipit.lst. wzzip -v test.zip Lists contents of Test.zip.
Using WZUNZIP
The general syntax for WZUNZIP is: wzunzip [options] zipfile [@listfile] [path] [files...] Elements in [brackets] are optional. The options specify what you want WZUNZIP to do and how to do it. Options are listed individually in the separate WZUNZIP reference section, but here is some general information: Options are introduced by either a hyphen ["-d"] or a forward slash ["/d"]. Multiple options must be separated by one or more spaces ("-d -n", not "-d-n"). If you don't specify any options, WZUNZIP unzips all specified file(s).
zipfile is the name of the Zip file you want to work with. You may specify a drive and/or folder. If you don't provide a filename extension, WZUNZIP adds ".zip". @listfile is the name of a text file that contains a list of the files to be extracted from the Zip file. Each line of the listfile can contain one filename. Filenames may also include wildcards. The wildcard specification "*" is assumed to mean "*.*", i.e., all files. The wildcard specification "*." means "all files that have no extension." Filenames containing spaces may be quoted, but this is not required in a listfile. Listfiles can also contain comments: any text following a semicolon (';') is ignored, up to the end of the line. Here is an example of the contents of a listfile: ; List of files to extract info.doc *.txt ; Extract all .txt files path specifies a drive and/or folder to which the files will be extracted. If not specified, files are extracted relative to the current directory on the current drive. files is a literally-specified list of one or more files to be extracted from the Zip file. Filename specifications follow the same rules as for file lists (above), except that filenames containing spaces must be enclosed in double quotes. If neither @listfile nor files is specified, WZUNZIP assumes *.*, i.e., all files in the Zip file.
Examples
wzunzip test.zip Extracts all files from Test.zip to the current directory. wzunzip test.zip abc.txt Extracts ABC.TXT from Test.zip. wzunzip -d test.zip Extracts all files from Test.zip, recreating the directory structure from folder information stored in the Zip file. New directories are created if necessary. Hint: if folder information is stored in the Zip file, you will almost always want to use the -d option. wzunzip -d test.zip c:\docs\ Extracts all files from Test.zip, recreating the directory structure from folder information stored in the Zip file. The files are stored under C:\DOCS. For example, if the file One.doc has no folder information in the Zip file, it would be stored as C:\Docs\One.doc; if the file Two.doc is stored in the Zip file with the folder Budget\, it would be stored as C:\Docs\Budget\Two.doc.
wzunzip test.zip @files.lst Extracts from Test.zip all files that are listed in the text file Files.lst. wzunzip -v test.zip Lists contents of Test.zip. wzunzip -v test.zip *.txt Lists all files with extension ".txt" in Test.zip.
WZZIP reference
Usage: wzzip [options] zipfile [@listfile] [files...] For information on the zipfile, listfile, and files components, see Using WZZIP. The options are:
-a -a+ Add files (default action).
Related option Remove the archive attribute from each file after adding it to the Zip file. As WinZip adds a file during the zipping process, the file's archive attribute is reset. Related options -b[drive|path] Use another drive for the temporary zip file. Since WZZIP creates a new, temporary zip file when it updates a file, sufficient space must be available on the current drive for that file. This option enables you to use another drive for that purpose when space considerations force the issue. -c Create or edit existing comments for all the files in the Zip file. Related options -C Create comments only for files being added that are not already in the Zip file. Related options -d Delete specified file(s) from the Zip file. -e<x|n|f|s|0> Set the compression level. -ex = maximum (smallest file); -en = normal; -ef = fast; -es = super speed; -e0 = no compression -f Freshen: replace files that are already part of the Zip file and are newer on disk. Related option -h|-? Show this help file -i[-] Add files whose archive attribute is set. By default the archive attribute is then removed. Use the optional "-" suffix to leave the archive attribute on. Related options -jhrs Do not store hidden, read only, and system attributes in the Zip file. (-whs controls whether hidden and system files are added.) Related options -Jhrs Store hidden, read only, and system attributes in the Zip file (default). (-whs controls whether hidden and system files are added.) Related options -k Do not update the Zip file's file date; retain the original date. Related option -m[f|u] Move files to the Zip file. When the Add|Freshen|Update operation is complete, the original files are deleted. Related option -o Change the Zip file's file date to the same as the newest file in the Zip file. Related option -p|P Store folder names. A lower case p stores only the names of folders recursed (subfolders included) via the -r option, while an upper case P stores all folder information specified on the command line. Related option -q Display ANSI control codes within comments (ansi.sys must be present). This option affects display only; it does not strip ANSI codes while creating a comment. Note: ansi.sys is not supported under Windows NT 4.0. -r Recurse into subfolders (include subfolders). This option requires the -p or -P option. Related option -s[password] Specify a password (if no password is given, a prompt will be generated). Passwords containing spaces must be enclosed in double quotes. -t[f][date] Include files with a date equal to or more recent than the date specified (current date if no date
specified). Date formats without the f modifier depend on country settings; examples with and without delimiters: United States: mmdd[yy]yy or [m]m/[d]d/[yy]yy Japan: [yy]yymmdd or [yy]yy/[m]m/[d]d Most of Europe: ddmm[yy]yy or [d]d.[m]m.[yy]yy valid delimiters are / . or The f modifier indicates that the date is specified in either of the following country-independent formats, regardless of the system's locale settings: [yy]yymmdd [yy]yy-[m]m-[d]d Note that years can be specified as two or four digits. Two digit years less than 80 are assumed to be 20##, while two digit dates greater than or equal to 80 are assumed to be 19##. Related option -T[f][date] Include files older than the date specified (current date if no date specified) Date formats without the f modifier depend on country settings; examples with and without delimiters: United States: mmdd[yy]yy or [m]m/[d]d/[yy]yy Japan: [yy]yymmdd or [yy]yy/[m]m/[d]d Most of Europe: ddmm[yy]yy or [d]d.[m]m.[yy]yy valid delimiters are / . or The f modifier indicates that the date is specified in either of the following country-independent formats, regardless of the system's locale settings: [yy]yymmdd [yy]yy-[m]m-[d]d Note that years can be specified as two or four digits. Two digit years less than 80 are assumed to be 20##, while two digit dates greater than or equal to 80 are assumed to be 19##. Related option -u Update: add files that are new or have changed. This command adds to the Zip file any files that are not already in the Zip file, and replaces any files that have a more recent date on disk. Put another way, this command is the same as -a (Add) except that it skips files that are already in the Zip file and have the same date in the Zip file and on disk.. Related option -v[b|t][r][m][c][d|e|n|o|p|s][f] View the list of files in the Zip file in one of the following formats: normal, brief, or t echnical. r reverses the sort order, m (more) pauses after each screen, and c displays any file comment. You can optionally sort by date, extension (file type), name, original order, percentage compression, or uncompressed size. The f option causes the date to be displayed in the format yyyy-mm-dd regardless of the local system's display settings. Related options -vi[m] View the Zip file's internal information. Use the optional "m" suffix to prevent text from scrolling off the screen. Related options -whs Include hidden and system files in the zipping process. Related options -Whs Exclude hidden and system files from the zipping process (default). Related options -x<filename> Exclude the specified file(s) from the zipping process. Wildcards are allowed. Related options -x@listfile Exclude the files listed in the specified listfile from the zipping process. This listfile uses the same format as the listfile used to specify files to be zipped (see WZZip Usage). Related options -yb[c] Automatic, non-interactive ("batch" mode) handling of prompts. If a prompt is issued, the operation terminate with error level 250. Use the optional c suffix to automatically continue with a "yes", "ok" response instead of terminating.
Force the use of MS-DOS (8+3) files names within the Zip file. Display a "Press any key to continue" prompt when the operation completes. This is particularly useful when running WZZIP from Start Menu's Run dialog box or from the "start" command. -z Create or edit a Zip file comment. Related options -&[w] Span to multiple removable disks. Use the optional w suffix to wipe out all files on the removable disk. [s[drive]] Use the optional s suffix to zip up entire disk with subfolders. (Windows NT must use "-&" or -^& due to cmd.exe requirements) -$[drive] Save volume label as a part of the Zip file; the current drive is used if not otherwise specified. -@list Create a file listing all the files that would be archived if this option were not specified. Hint: remember to use the leading dash to create a list. Leave out the leading dash to use a list of files in a WZUNZIP command. Related options -^ Display the command line on your screen (Windows NT users must specify "-^" or -^^ due to cmd.exe requirements)
-yk -yp
WZUNZIP reference
Usage: wzunzip [options] zipfile [@listfile] [[drive:][\][path][\]] [files...] For information on the zipfile, listfile, path, and files components, see Using WZUNZIP. The options are as follows:
Display the contents of files on the screen. Use the optional "m" suffix to prevent text from scrolling off the screen. Related options -d Recreate the folder structure that is stored within the Zip file. Related options -f Extract only those files that currently exist in the target folder ("freshen"). If the Zip file contains a newer version of a file that already exists in the target folder, it will be extracted, replacing the older version. No files are extracted from the Zip file that do not already exist in the target folder. Related options -h|-? Show this help file. -jhrs Do not set hidden, read only, and system attributes on files during the unzipping process (default). In other words, ignore any attributes stored in the Zip file. Related option -Jhrs Restore the hidden, read only, and system attributes on files during the unzipping process. In other words, use any attributes stored in the Zip file. Related option -n Unzip only newer files. This option updates existing files if the archived file is newer and creates new ones if they do not already exist. Related options -o[-] Overwrite existing files without a prompt (automatically reply "Yes" to each overwrite prompt). Use the optional "-" suffix to automatically reply "No" to each overwrite prompt. Related options -p Print a file. The contents of the file are sent directly to the LPT1 printer port; therefore, this option should be used to print ASCII text files only, and only if a printer that can print ASCII text is attached directly to LPT1. It is not intended for use in printing data files such as spreadsheets or word processor documents. -q Display ANSI control codes within comments (ansi.sys must be present). Note: ansi.sys is not supported under Windows NT 4.0. -s[password] Specify a password (if no password is given, a prompt will be generated). Passwords containing spaces must be enclosed in double quotes. -t Test the Zip file. -v[b|t][r][m][c|d|e|n|o|p|s][f] View the list of files in the Zip file in one of the following formats: normal, brief, or t echnical. r reverses the sort order, while m (more) pauses after each screen. You can optionally sort by CRC, date, extension (file type), name, original order, percentage compression, or uncompressed size. The f option causes the date to be displayed in the format yyyy-mm-dd regardless of the local system's display settings. Related options -vi[m] View the Zip file's internal information. Use the optional "m" suffix to prevent text from scrolling off the screen. Related options -x<filename> Exclude the specified file(s) from the unzipping process. Wildcards are allowed. Related option -x@listfile Exclude the files listed in the specified listfile from the unzipping process. The listfile uses the same format as the listfile of files to be unzipped (see Using WZUNZIP). Related option -yb[c] Automatic, non-interactive ("batch" mode) handling of prompts. If a prompt is issued, the operation -c[m]
-yo -yO
-^
terminates with error level 250. Use the optional c suffix to automatically continue with a "yes", "ok", or "overwrite" response instead of terminating. Related option Overwrite hidden, system, and read-only files. If -yo is not specified, these files will be skipped. Related option Include files with relative folder information containing ".." (parent folder) in the unzipping process when -d is also specified. If -yO is not specified, these files will be skipped. Note that the use of ".." is very unusual in Zip files and can produce undesirable results including the overwriting of important system files. You may wish to review the contents of the Zip file carefully before unzipping with -yO especially if you are uncertain of the Zip file's source. Related option Display a "press any key to continue" prompt when the operation completes. This is particularly useful when running WZUNZIP from Start Menu's Run dialog box or from the "start" command. Replace any spaces in file names with underscore ("_") character. Restore volume label, if the Zip file contains a volume label, and if the target is a removable disk. Related option Create a file listing all the files that would be unzipped if this option were not specified. Hint: remember to use the leading dash to create a list. Leave out the leading dash to use a list of files in a WZUNZIP command. Related options Display the command line on your screen. (Windows NT users must specify "-^" or -^^ due to cmd.exe requirements)
Technical Support
If you have difficulties using the WinZip Command Line Support Add-On, please review this help file. If this does not resolve your problem, technical support is available at no charge as described below. The best way to report problems is with the support form available from the Support link on the WinZip home page at http://www.winzip.com. You can also send electronic mail to support@winzip.com on the Internet, or send postal mail to WinZip Computing, Inc., P.O. Box 540, Mansfield CT 06268. When reporting problems, please include the following information: 1. Is the problem reproducible? If so, how? Is the problem with WZZIP or WZUNZIP? 2. What version of Windows are you running? For example, Windows 98 or Windows NT 4.0. 3. What version of the WinZip Command Line Add-On are you using? Type WZZIP or WZUNZIP at the command prompt and note the first displayed line. Please include the entire line in your problem report, e.g., " WinZip(R) Command Line Support Add-On (Build 3119) ". 4. If an error message was displayed, please provide the full text of the message.
Page1 of 3
Adding Files
The command format is:
winzip32 [-min] action [options] filename[.zip] files
where: -min specifies that WinZip should run minimized. If -min is specified, it must be the first command line parameter. action -a for add, -f for freshen, -u for update, and -m for move. You must specify one (and only one) of these actions. The actions correspond to the actions described in the section titled "Add dialog box options" in the online manual. 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. If you add -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. http://www.winzip.com/xcmdline.htm 10/07/2003
Page2 of 3
-ex, -en, -ef, -es, and -e0 determine the compression method: eXtra, Normal, Fast, Super fast, and no compression. The default is "Normal". -hs includes hidden and system files. Use -sPassword to specify a case-sensitive password. The password can be enclosed in quotes, for example, -s"Secret Password". filename.zip Specifies the name of the Zip file involved. Be sure to 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. *.bak) are allowed.
Extracting Files
The command format is:
winzip32 -e [options] filename[.zip] folder
where -e is required. options -o and -j stand for "Overwrite existing files without prompting" and "Junk pathnames", respectively. Unless -j is specified, folder information is used. Use sPassword to specify a case-sensitive password. The password can be enclosed in quotes, for example, -s"Secret Password". filename.zip Specifies the name of the Zip file involved. Be sure to specify the full filename (including the folder). folder Is the name of the folder to which the files are extracted. If the folder does not exist it is created.
Notes
l
VERY IMPORTANT: always specify complete filenames, including the full folder name and drive letter, for all file IDs. To run WinZip in a minimized inactive icon use the "-min" option. When specified this option must be the first option. Only operations involving the built-in zip and unzip are supported. Enclose long filenames in quotes. When using a list ("@") file, no leading or trailing spaces should appear in file IDs in the list.
http://www.winzip.com/xcmdline.htm
10/07/2003
Page3 of 3
The action and each option must be separated by at least one space. WinZip can be used to compress files with cc:Mail . Change the compress= line in the [cc:Mail] section of the appropriate WMAIL.INI files to specify the full path for WinZip followed by "-a %1 @%2". For example, if WinZip is installed in your c:\winzip folder, specify
compress=c:\winzip\winzip.exe -a %1 @%2
Return to WinZip Home Page Basic WinZip Information | What's New | Search | Order Now Download Evaluation Version | Download Upgrade | Other Downloads WinZip Self-Extractor | Beta Page | Mailing List FAQs | Support
http://www.winzip.com/xcmdline.htm
10/07/2003