CmdID

CmdID / Commands

compact

Displays or alters the compression of files or directories on NTFS partitions. Windows commands reference

On Windows 1 sub-command File compact.exe

Opens CmdID with your command. It is read in your browser and sent nowhere.

Windows

from the Windows commands reference, CC BY 4.0

Displays or alters the compression of files or directories on NTFS partitions. If used without parameters, compact displays the compression state of the current directory and any files it contains.

compact [/C | /U] [/S[:dir]] [/A] [/I] [/F] [/Q] [/EXE[:algorithm]] [/CompactOs[:option] [/windir:dir]] [filename [...]]

To set the compression state of the current directory, its subdirectories, and existing files, type

compact /c /sIdentify
/cCompresses the specified directory or file. Windows commands reference
/sPerforms the chosen operation on files in the specified directory and all subdirectories. Windows commands reference

To set the compression state of files and subdirectories within the current directory, without altering the compression state of the current directory itself, type

compact /c /s *.*Identify
/cCompresses the specified directory or file. Windows commands reference
/sPerforms the chosen operation on files in the specified directory and all subdirectories. Windows commands reference

To compress a volume, from the root directory of the volume, type

compact /c /i /s:\Identify
/cCompresses the specified directory or file. Windows commands reference
/iContinues performing the specified operation, ignoring errors. Windows commands reference
/sPerforms the chosen operation on files in the specified directory and all subdirectories. Windows commands reference

To compress all files with the .bmp file name extension in the \tmp directory and all subdirectories of \tmp, without modifying the compressed attribute of the directories, type

compact /c /s:\tmp *.bmpIdentify
/cCompresses the specified directory or file. Windows commands reference
/sPerforms the chosen operation on files in the specified directory and all subdirectories. Windows commands reference

To force complete compression of the file zebra.bmp, which was partially compressed during a system crash, type

compact /c /f zebra.bmpIdentify
/cCompresses the specified directory or file. Windows commands reference
/fForces compression or uncompression of the specified directory or file. Windows commands reference

To remove the compressed attribute from the directory c:\tmp, without changing the compression state of any files in that directory, type

compact /u c:\tmpIdentify
/uUncompresses the specified directory or file. Windows commands reference
/cCompresses the specified directory or file. Directories are marked so any files added afterwards are compressed, unless the /EXE parameter is specified.
/uUncompresses the specified directory or file. Directories are marked so any files added afterwards aren't compressed. If the /EXE parameter is specified, only files compressed as executables are uncompressed; if you don't specify the /EXE parameter, only NTFS compressed files are uncompressed.
/s[:<dir>]Performs the chosen operation on files in the specified directory and all subdirectories. By default, the current directory is used as the <dir> value.
/aDisplays hidden or system files. By default, these files aren't included.
/iContinues performing the specified operation, ignoring errors. By default, this command stops when an error is encountered.
/fForces compression or uncompression of the specified directory or file. Already-compressed files are skipped by default. The /f parameter is used in the case of a file that was partly compressed when the operation was interrupted by a system crash. To force the file to be compressed in its entirety, use the /c and /f parameters and specify the partially compressed file.
/qReports only the most essential information.
/EXEUses compression optimized for executable files that are read frequently, but not modified. Supported algorithms are: - XPRESS4K (fastest and default value) - XPRESS8K - XPRESS16K - LZX (most compact)
/CompactOsSets or queries the system's compression state. Supported options are: - query - Queries the system's Compact state. - always - Compresses all operating system binaries and sets the system state to Compact, which remains unless administrator changes it. - never - Uncompresses all operating system binaries and sets the system state to non-Compact, which remains unless administrator changes it.
/windirUsed with the /CompactOs:query parameter, when querying the offline operating system. Specifies the directory where Windows is installed.
<filename>Specifies a pattern, file, or directory. You can use multiple file names, and the * and ? wildcard characters.
/?Displays help at the command prompt.

Windows

from tldr-pages, CC BY 4.0

Display or change the compression state of files and directories on NTFS partitions.

Display the compression status of files in the current directory

compactIdentify

Compress a specific file

compact /c path\to\fileIdentify
/cCompresses the specified directory or file. Windows commands reference

Uncompress a specific file

compact /u path\to\fileIdentify
/uUncompresses the specified directory or file. Windows commands reference

Compress all files in a directory and its subdirectories

compact /c /s path\to\directoryIdentify
/cCompresses the specified directory or file. Windows commands reference
/sPerforms the chosen operation on files in the specified directory and all subdirectories. Windows commands reference

Uncompress all files in a directory and its subdirectories

compact /u /s path\to\directoryIdentify
/uUncompresses the specified directory or file. Windows commands reference
/sPerforms the chosen operation on files in the specified directory and all subdirectories. Windows commands reference

Sub-commands

each with its page