[Contents] [Back] [<< Prev] [Next >>]

Implementing Compression Through the Command Line

To compress a file or folder through the command line, use the compact command. The syntax of the command is as follows:

compact [/c] [/u] [/s[:folder]] [/a] [/i] [/f] [/q] [filename [...]]

Where:
 none displays the compression state of the current folder.
 /c compresses the specified folder or file.
 /u uncompresses the specified folder or file.
 /s[:folder] specifies that the requested action (compress or uncompress) be applied to all subfolders of the specified folder or to the current folder if none is specified.
 /i ignores errors.
 /f forces compression or uncompression of the specified folder or file.
 /a displays files with the hidden or system attribute.
 /q reports only the most essential information.
 filename specifies a pattern, file, or folder. You can use multiple file names and wild cards.
You may choose to use the command line utility rather than the Properties tab for the file or folder if you want to implement compression as part of a batch file.


[note.gif]

The command line utility, compact, automatically compresses all files and subfolders when you change the compression attribute of a folder without prompting you beforehand. If you do not wish to do that, you can use the Graphical Properties tab for that file or folder.