compact.exe displays or alters the compression of files on NTFS partitions.
Because compression is an NTFS feature, files can be compressed transparently, i. e. they don't need to be decompressed manually before using them (this is done in the «background»).
compact can be invoked without command line parameters in which case it simply reports the compression state of the current directory and any files it contains.
Wildcards are supported.
Multiple filenames and wildcards can be specified.
Note that hidden and system files are not displayed by default. /a is needed to show them as well.
Command line options
/c
Compresses the specified files. Directories will be marked so that files added afterward will be compressed unless /exe is specified.
/u
Uncompresses the specified files. Directories will be marked so that files added afterward will not be compressed. If /exe is specified, only files compressed as executables will be uncompressed; if this is omitted, only NTFS compressed files will be uncompressed.
/s:dir
Performs the specified operation on files in the given directory and all subdirectories. If omitted, it defaults to the current directory.
/a
Displays files with the hidden or system attributes. These files are omitted by default.
/i
Continues performing the specified operation even after errors have occurred. By default, compact stops when an error is encountered.
/f
Forces the compress operation on all specified files, even those which are already compressed. Already-compressed files are skipped by default.
Set or query the system's compression state. Supported options are: query: Query the system's Compact state; always: Compress all OS binaries and set the system state to compact which remains unless administrator changes it; never: Uncompress all OS binaries and set the system state to non-compact which remains unless administrator changes it.
/winDir
Used with /CompactOs:query when querying the offline OS to secifies the directory where Windows is installed.
Supported algorithms
compact.exe supports the following algorithms for the /exe parameter: