File Systems

Previous Topic Next Topic

Compressing and Decompressing Folders and Files

Files and folders on an NTFS volume are either compressed or decompressed. The compression state of a folder does not reflect the compression state of the files in that folder. For instance, a folder may be compressed, yet all or some of the files in that folder could be decompressed if they were moved from a compressed folder of if you selectively decompressed some of the files in the folder.

You can set the compression state of folders and compress or decompress files by using My Computer or a command-line program called Compact. When using My Computer, you can set the compression state of an NTFS folder without changing the compression state of existing files in that folder. If you have Read or Write permission, you can change the compression state locally or across a network. You have the option of selecting individual folders or files to compress or decompress.

To set the compression state of a folder

  1. Start Windows Explorer. In the left pane, select the folder you want to compress or decompress.
  2. On the File menu, click Properties to display the Properties dialog box.
  3. On the General tab, click Advanced.
  4. In the Advanced Attributes dialog box, select or clear the Compress contents to save disk space check box, and then click OK.
  5. In the Properties dialog box, click OK.

Windows 2000 then displays the Confirm Attribute Changes dialog box. This dialog box gives you the option of either compressing the folder only, or compressing the folder and its subfolders and files. To keep existing files or subfolders in the NTFS folders in their current compression state, click Apply changes to this folder only, and then click OK.

To compress or decompress individual files

  1. Start Windows Explorer. In the left pane, select the file you want to compress or decompress.
  2. On the File menu, click Properties to display the Properties dialog box.
  3. On the General tab, click Advanced.
  4. In the Advanced Attributes dialog box, select or clear the Compress contents to save disk space check box, and then click OK.
  5. In the Properties dialog box, click OK.

note-icon

Note

Windows 2000 allows closed page files to be compressed. However, when you restart Windows 2000, the page files automatically revert to an uncompressed state. For information about page files, see the topics about virtual memory in Windows 2000 Server Help.

You can set My Computer to display alternate colors for compressed files and folders with the following procedure:

To display alternate colors for compressed files and folders

  1. In My Computer, select the Tools menu.
  2. On the Tools menu, click Folder Options.
  3. On the View tab, select or clear the Display compressed files and folders with alternate color check box.
  4. Click OK to return to My Computer.

Using the Compact Program

The Compact program is the command-line version of the compression functionality in My Computer. The compact command displays and alters the compression of folders and files on NTFS volumes. It also displays the compression state of folders.

There are two reasons why you might want to use Compact instead of My Computer:


note-icon

Note

Unlike My Computer, Compact does not prompt you to compress or uncompress files and subfolders when you set the compression state of a folder; it automatically compresses or decompresses any files that are not already in the compression state that you set for the folder.

For more information about the Compact program, at the command prompt, type:

compact /?

or see "File System Tools" later in this chapter.

© 1985-2000 Microsoft Corporation. All rights reserved.