Sunteți pe pagina 1din 17

WinZip Command Line Support Add-On

Page1 of 2

WinZip Command Line Support AddOn Release 1.0


Description
The WinZip Command Line Support Add-On provides a command line interface that gives you the power of WinZip without the usual WinZip graphical user interface. The WinZip Command Line Support Add-On allows you to use WinZip directly from the command prompt and from batch (.BAT) files and script languages. The add-on is ideal for quick zipping and unzipping from the command line and for automating repetitive tasks using batch files or scripts. An extensive set of command line options gives you pinpoint control over WinZip's actions. And, in automated environments, end-users need not know anything about how to use WinZip. Also available is a beta version of Release 1.1 of the WinZip Command Line Support Add-On. This beta version supports additional command line options, and also supports the Zip file format extensions that permit more and larger files to be stored in a Zip archive. Please see the WinZip Command Line Support Add-On Beta page for a list of new features and download instructions.

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

Downloading and Installing the WinZip Command Line Support Add-On


Use the link below to download the WinZip Command Line Support Add-On. After downloading, double-click the downloaded file in My Computer or Windows Explorer, or click Run from the Start menu, type the name of the downloaded file (for example, C:\DNLOAD\WZCLINE.EXE), and press Enter. Then follow the prompts to install the add-on. Download the WinZip Command Line Support Add-On (wzcline.exe - 288,232 bytes, 282KB)

Support and Questions


If you have questions or comments, please visit the WinZip Support page.

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.

Using the WinZip Command Line Support Add-On


The WinZip Command Line Support Add-On is used by executing a command that starts WZZIP or WZUNZIP. There are three "places" where you can use the Add-On: In a command window, sometimes known as a DOS window or DOS box. This is a separate window that is normally started by selecting "MS-DOS Prompt" or "Command Prompt" from the Start menu; it normally displays the C> prompt. From the Run dialog, accessed from the Start menu. In batch files or other scripts (such as application program macros).

The exact format of the command depends on which of these you use.

Using a command window


You can use the Add-On in a command window in any of these ways: You can type the full name of the WinZip folder followed by the name of the command, which is either "WZZIP" (for zipping) or "WZUNZIP" (for unzipping), followed by the parameters necessary for the operation. For example, if you installed WinZip into the C:\Program Files\WinZip folder and you want to list the contents of MyFile.zip, you might type: "c:\program files\winzip\wzzip" -v MyFile.zip (Note that you must use quotes around the command name if the name of the folder includes spaces, as shown above. Otherwise, the quotes are not necessary.) You can copy WZZIP.EXE and WZUNZIP.EXE to a folder specified in your PATH environment variable. Then you can run the commands by simply typing "WZZIP" or "WZUNZIP" and the desired parameters, without the name of the WinZip folder: wzzip -v filename.zip You can add the WinZip folder to your PATH environment variable, for example: set path=c:\windows;c:\program files\winzip;... If you have done this, you can run the commands at the system prompt by simply typing "WZZIP" or "WZUNZIP" followed by the desired parameters, without the name of the WinZip folder: wzzip -v filename.zip

(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 the Run dialog


You can use WZZIP.EXE and WZUNZIP.EXE from the Run dialog by simply typing the command name and any desired parameters. It is not necessary to include the WinZip folder, but you may need to specify the folder for the files you wish to work with. For example: wzzip -yp -v c:\temp\filename.zip We recommend using the -yp option to keep the MS-DOS command prompt window from closing automatically; otherwise, you will not have much time to look at the results of your command.

Using batch files


You can use WZZIP.EXE and WZUNZIP.EXE in MS-DOS batch files using the same rules as shown above for command windows. The procedure will be similar for script processors other than MS-DOS batch files (application program macros, for example). However, check your documentation for information on how paths should be specified.

Using return codes (errorlevels)


WZZIP and WZUNZIP will in most cases return a nonzero errorlevel in the event of a serious error; otherwise, an errorlevel of 0 is returned. You can use these return codes in batch files and other automated processing. For example: wzzip filename.zip *.doc If Not ErrorLevel 1 Goto Exit Echo ***SERIOUS ERROR DETECTED*** :Exit

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

-yp -ys -$ -@list

-^

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.

WinZip - Command Line Parameters

Page1 of 3

What command line parameters does WinZip support?


Below is some information about the undocumented command line options for using the WinZip program module, winzip32.exe. The WinZip Command Line Support Add-On provides comprehensive support for command line zipping and unzipping. For more information, please see the WinZip Command Line Support Add-On Information Page. Note that not all the commands and switches available in the WinZip Command Line Support Add-On are available for the winzip32.exe command line, and even if the same switches are available in each interface, they may function differently. WinZip supports command line options to add and extract from files. Be sure to read the Notes section below for additional important information.

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

WinZip - Command Line Parameters

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

WinZip - Command Line Parameters


l

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 Frequently Asked Questions

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

S-ar putea să vă placă și