Video Screencast Help
Endpoint Management Community Blog

COMPACT.EXE Search Parameters

Created: 05 Jun 2008 • Updated: 05 Jun 2008 • 1 comment
CondorMan's picture
+1 1 Vote
Login to vote

If your workstations are using the NTFS file system, you can use COMPACT.EXE that is included with Windows to compress files with a certain extension. For example, to compress all of the .CHM files (which are rarely used), use the command: COMPACT /C /S:C:\ *.CHM

Here is a list of all the available parameters:

COMPACT [/C | /U] [/S[:dir]] [/A] [/I] [/F] [/Q] [filename [...]]

/C Compresses the specified files. Directories will be marked so that files added afterward will be compressed.
/U Uncompresses the specified files. Directories will be marked so that files added afterward will not be compressed.
/S Performs the specified operation on files in the given directory and all subdirectories. Default "dir" is 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.
/Q Reports only the most essential information.
filename Specifies a pattern, file, or directory.

Used without parameters, COMPACT displays the compression state of the current directory and any files it contains. You may use multiple filenames and wildcards. You must put spaces between multiple parameters.

Comments 1 CommentJump to latest comment

DustyPete's picture

Ah, cute!

We always went into Explorer (r-click folder, General->Advanced, Compress content checkbox) where we store images of our source code (mostly text files and access speed is not an issue) and never bothered to check if it could be automated!



Login to vote