Table of Contents
Compact Command in Windows is easier to understand when the core ideas are paired with practical examples. The sections below explain the topic clearly, highlight useful steps, and point out details that can prevent common errors.
The compact command displays or changes the process of compressing files or folders on an NTFS partition. If used without parameters, the compact command displays the compression status of the current directory and the files contained therein.
For an example of how to use this command, please see the Example below.
Compact command syntax
compact [/c | /u] [/s[:
Parameters
Parameter Description / c Compress the specified directory or file. / u Extract the specified file or folder. /S[:Note
- Compact command is the command line version of NTFS file system compression. The compression status of a directory indicates whether files are automatically compressed when they are added to the folder. Setting the compression status of a directory does not necessarily change the compression status of the files already in the directory.
- You cannot use the compact command to read, write or mount compressed drives using DriveSpace or DoubleSpace.
- You cannot use the compact command to compress File Allocation Table (FAT) partitions or FAT32 partitions.
As an example,
To set the compression status of the current directory, its subfolders and existing files, enter:
compact /c /s
To set the compression status of files and subdirectories in the current directory, without changing the compression status of the current directory, enter:
compact /c /s *.*
To compress a drive, from the root directory (the root directory of that drive), enter:
compact /c /i /s:
Note:
This example sets the compression status of all folders (including the root directory on the drive) and compresses all files on that drive. The / i parameter prevents error messages that interrupt the compression process.
To compress all files with the .bmp extension in the Tmp folder and all Tmp subdirectories , without modifying the compression properties of the directories, enter:
compact /c /s:tmp *.bmp
To force full compression of Zebra.bmp file , partially compressed while the system crashes, enter:
compact /c /f zebra.bmp
- Comp command in Windows
- The convert in Windows command
- The cipher command in Windows
FAQ
What should you know about compact command syntax compact [/c | /u] [/s[: ]] [/ a] [/ i] [/ f] [/ q] [[.]] Parameters Parameter Description / c Compress the specified directory or file. / u Extract the specified file or folder. /S[: ] Apply compact commands to all subdirectories of the specified directory (or of the current directory if no directory is specified). / a Displays system files or hidden files. / i Ignore the error. / f Force compression or decompressing the specified directory or file. The / f parameter is used in case the file is partially compressed when the operation is interrupted due to a system error. To force the entire file to be fully compressed, use the / c and / f parameters and then specify the new partially compressed file. / q Only report the most necessary information. Specify file or directory. You can use multiple file names, and wildcards * and ? . /? Show help at the command prompt. Note Compact command is the command line version of NTFS file system compression. The compression status of a directory indicates whether files are automatically compressed when they are added to the folder. Setting the compression status of a directory does not necessarily change the compression status of the files already in the directory. You cannot use the compact command to read, write or mount compressed drives using DriveSpace or DoubleSpace. You cannot use the compact command to compress File Allocation Table (FAT) partitions or FAT32 partitions. As an example,?
To set the compression status of the current directory, its subfolders and existing files, enter:
What is Compact Command in Windows?
The compact command displays or changes the process of compressing files or folders on an NTFS partition.
Why is Compact Command in Windows important?
A clear understanding of Compact Command in Windows helps you make informed decisions, avoid common mistakes, and use the relevant tools or techniques more effectively.
Reader Comments 0
Sign in with email or Google to join the discussion.