Compact: Compresses and Uncompresses NTFS Files and Folders

The compact utility is the command line version of the compression functionality in My Computer or Windows NT Explorer. The compact command displays and alters the compression of folders and files on NTFS volumes. It also displays the compression state of folders. For more information about this utility, type compact /? at the command prompt. The following table describes the options.

The format of the command is:


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

Option

Description

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 filenames and wild cards.


There are reasons why you would want to use this utility instead of My Computer or Windows NT Explorer:

Note

The Compact utility automatically compresses or uncompresses all of the files and subfolders when you change the compression state of a folder. It does not ask whether you want to change the compression state of the files or subfolders within it.