Zip

Top  Previous  Next

 

The Zip command allows you to compress one or more files into a single file in the same or another location.

 

ZIP is an archive file format that supports lossless data compression. Zipped files take up less storage space and can be transferred to other computers more quickly than uncompressed files. In Windows, you can work with zipped files and folders in the same way that you work with uncompressed files and folders.

 

Command Syntax

 

Zip:[SourceFileNames],[TargetFileName]

 

The colon after the command and the comma between parameters are compulsory. Any additional spaces or characters will cause an error to be thrown. The command itself is not case sensitive, but parameters may be depending on the operating system and locale.

 

Parameters:

 

SourceFileNames: The fully qualified path and file name identifying the file or files to copy. Wildcard characters are supported for file names, as are multiple files separated by Pipe characters.

TargetFileName: The fully qualified path and file name to which the file should be copied

 

All parameters are compulsory. If any parameter is missing or invalid an error will be thrown. The parameters must be surrounded by quotation marks if one or more spaces are included in the path and file name. It is good practice to include the quotation marks in any case, so that it reduces the risk of error when writing scripts.

 

Examples:

 

Zip a Single File:

 

Zip:"C:\Test Text.txt","C:\Test Text.zip"

 

Zip Multiple Files:

 

Zip:"C:\Test Text.txt|C:\Test Html.html","C:\Test Text.zip"

 

Zip files with a Wildcard:

 

Zip:"C:\*.txt","C:\Test Text Files.zip"

 

 

See Also: CopyFile FtpUpload