A+ Certification / Beginners

Windows 2000 and Windows XP extended attributes

Windows 2000 and other newer Microsoft operating systems have three other file attributes that are used on NTFS partitions. These three attributes are often referred to as extended attributes:

  • Compress: Used to enable on-the-fly file level compression of data
  • Encrypt: Used to enables on-the-fly file level encryption of data
  • Index: Used to allow files to be indexed by the OS Indexing Service.

The sections that follow take a closer look at each of these attributes.


The Compress attribute allows and restricts file compression. To compress a file or folder, follow these steps:

  1. Right-click the file or folder and choose Properties. The Properties dialog box appears.
  2. Click the Advanced button. The Advanced Attributes dialog box pops up.
  3. You will be able to compress the file or folder by selecting the Compress Contents to Save Disk Space check box.

To compress a file, then file needs to be read in to memory, where compression takes place, and then re-written to the disk is it's compressed form. When you change the compress file attribute, then the OS saves the change to attribute prior to actually going to steps of compression the file. This is done in two steps, since the attributes are stored in the MFT (Master File Table), and not in the actual file itself. After the attribute change is recorded, file compression for that file is performed. There is a small chance that something may go wrong during the compression phase, so that some of the files on your hard drive may have the Compress attribute set but may not actually be compressed. One situation that may cause this inconsistent Compress attribute is a power interruption during the compression process, so that the attribute change was made but the compressed version of the file was not saved. To ensure that this has not happened, you could use the command line utility, compact.exe.

compact.exe can be used to compress or decompress files from the command line. It supports switches that will allow it to process subdirectories as well. If you suspect inconsistent compression states for your files, you can use the /F or force switch, which goes through the process of compressing all files, even if they already have the compress attribute, this does not double compress files, but rather ensures that all files that are suppose the be compressed actually are compressed. See Table below for a complete list of the switches that compact.exe makes use of. If you run compact.exe without any switches, it will display compression information for the files in your current directory.

/CCompresses the specified files. Directories will be marked so that files added afterward will be compressed.
/UUncompresses the specified files. Directories will be marked so that files added afterward will not be compressed.
/SPerforms the specified operation on files in the given directory and all subdirectories. Default "dir" is the current directory.
/ADisplays files with the hidden or system attributes. These files are omitted by default.
/IContinues performing the specified operation even after errors have occurred. By default, COMPACT stops when an error is encountered.
/FForces the compress operation on all specified files, even those which are already compressed. Already-compressed files are skipped by default.
/QReports only the most essential information.
[Previous] [Contents] [Next]