Compress: Compresses Files or Folders

Compress is a command-line utility that can be used to compress one or more files. You cannot open a file that has been compressed using this utility until you have expanded it with Expand. To use this program, at the command line type:


with the appropriate options. Table 3.16 describes the options available with Compress. The syntax of the command is:

compress [– r ] [– d ] source [ destination ]

Table   3.16 Compress Options




Renames compressed files.


Updates compressed files only if out of date.


Specifies the source file. The asterisk ( * ) and question mark ( ? ) wildcard characters can be used.


Specifies the destination file or path. The destination can be a folder. If source specifies multiple files and the – r option is not specified, then destination must be a folder.



Do not use Compress to compress files or folders on NTFS volumes. Instead, compress NTFS files and folders with Compact or by setting or clearing the Compressed attribute in My Computer. For information about using My Computer, see "Compact: Compresses and Decompresses NTFS Files and Folders" earlier in this chapter.