Name

NTFS Compression Utility — \windows\system32\compact.exe

Synopsis

View or configure the automatic file compression on NTFS drives.

To Open

Command Prompt compact

Usage

compact [/c | /u] [/s[:dir]] [/a] [/i] [/f] [/q] [filename]

Description

One of the features of the NTFS filesystem (see FAT to NTFS Conversion Utility, earlier in this chapter) is its support for automatic compression of individual files; older files can be optionally compressed to take up less disk space at the expense of speed to access them.

Right-click on any file or folder, select Properties, and then click the Advanced button. The “Compress contents to save disk space” option is used to instruct Windows to compress the selected item. If a folder is selected, all of its contents will be compressed (you’ll be prompted about any subfolders); furthermore any files added to that folder will be automatically compressed as well.

The NTFS Compression Utility is the command-line equivalent of this setting, useful for automating the compression or decompression of several files with the help of a WSH script or batch file. The NTFS Compression Utility takes the following options:

filename

Specifies a file, folder, or group of files (using wildcards) to compress or uncompress.

/c

Compresses the specified file(s). If a folder is specified for filename, the folder will be marked so that subsequent files added to the folder will be compressed automatically. Include the /s parameter to compress files already in the folder. ...

Get Windows XP in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.