Using File-Based Compression

File-based compression allows you to reduce the number of bits and bytes in files so that they use less space on a disk. The Windows operating system supports two types of compression: NTFS compression, which is a built-in feature of NTFS, and compressed (zipped) folders, which is an additional feature of Windows available on both FAT and NTFS volumes.

NTFS Compression

Windows allows you to enable compression when you format a volume using NTFS. When a drive is compressed, all files and folders stored on the drive are automatically compressed when they are created. This compression is transparent to users, who can open and work with compressed files and folders just as they do with regular files and folders. Behind the scenes, Windows decompresses the file or folder when it is opened and compresses it again when it is closed. Although this can decrease a computer's performance, it saves space on the disk because compressed files and folders use less space.

You can turn on compression after formatting volumes as well, or if desired turn on compression only for specific files and folders. Once you compress a folder, any new files added or copied to the folder are compressed automatically and they remain compressed even if you later move them to an uncompressed folder on an NTFS volume.

Moving uncompressed files to compressed folders affects their compression attribute as well. If you move an uncompressed file from a different drive to a compressed drive or folder, the file is compressed. However, if you move an uncompressed file to a compressed folder on the same NTFS drive, the file isn't compressed. Finally, if you move a compressed file to a FAT16 or FAT32 volume, the file is uncompressed because FAT16 and FAT32 volumes do not support compression.

To compress or uncompress a drive, follow these steps:

  1. Right-click the drive that you want to compress or uncompress in Windows Explorer or in the Disk Management Volume List view, and then select Properties. This displays the disk's Properties dialog box, as shown in Figure 20-6.

    You can compress entire volumes or perform selective compression for specific files and folders

    Figure 20-6. You can compress entire volumes or perform selective compression for specific files and folders

  2. Select or clear Compress Drive To Save Disk Space as appropriate. When you click OK, the Confirm Attribute Changes dialog box shown in Figure 20-7 is displayed.

    Choose a compression option

    Figure 20-7. Choose a compression option

  3. If you want to apply changes only to the root folder of the disk, select Apply Changes To X Only. Otherwise, accept the default, which will compress the entire contents of the disk. Click OK.

Caution

Although Windows Server 2003 will let you compress system volumes, this is not recommended because the operating system will need to decompress and compress system files each time they are opened, which can seriously impact server performance. Additionally, you can't use compression and encryption together. You can use one feature or the other, but not both.

You can selectively compress and uncompress files and folders as well. The advantage here is that this affects only a part of a disk, such as a folder and its subfolders, rather than the entire disk. To compress or uncompress a file or folder, follow these steps:

  1. In Windows Explorer, right-click the file or folder that you want to compress or uncompress, and then select Properties.

  2. In the General tab of the related Properties dialog box, click Advanced. This displays the Advanced Attributes dialog box shown in Figure 20-8. Select or clear Compress Contents To Save Disk Space as appropriate. Click OK twice.

    Use the Advanced Attributes dialog box to compress the file or folder

    Figure 20-8. Use the Advanced Attributes dialog box to compress the file or folder

  3. If you are changing the compression attributes of a folder with subfolders, the Confirm Attribute Changes dialog box is displayed. If you want to apply the changes only to the files in the folder and not files in subfolders of the folder, select Apply Changes To X Only. Otherwise, accept the default, which will apply the changes to the folder, its subfolders, and files. Click OK.

Windows Server 2003 also provides command-line utilities for compressing and uncompressing your data. The compression utility is called Compact (Compact.exe). The decompression utility is called Expand (Expand.exe).

Compressed (Zipped) Folders

Compressed (zipped) folders are another option for compressing files and folders. When you compress data using this technique, you use Zip compression technology to reduce the number of bits and bytes in files and folders so that they use less space on a disk. Compressed (zipped) folders are identified with a zipper on the folder icon and are saved with the .zip file extension.

Note

At the time of this writing, compressed (zipped) folders were not available on 64-bit editions of Windows Server 2003. Further, if you install a Zip utility, the compressed folder icon for this utility might be used and some of the built-in compressed (zipped) folder features can change.

Compressed (zipped) folders have several advantages over NTFS compression. Because zip technology is an extension of the operating system rather than the file system, compressed (zipped) folders can be used on both FAT and NTFS volumes. Zipped folders can be password protected to safeguard their contents and can be sent by e-mail. They can also be transferred using File Transfer Protocol (FTP), Hypertext Transfer Protocol (HTTP), or other protocols. An added benefit of zipped folders is that some programs can be run directly from compressed folders without having to be decompressed. You can also open files directly from zipped folders.

You can create a zipped folder by selecting a file, folder, or a group of files and folders in Windows Explorer, right-clicking, pointing to Send To, and clicking Compressed (Zipped) Folder. The zipped folder is named automatically by using the file name of the last item selected and adding the .zip extension. If you double-click a zipped folder in Windows Explorer, you can access and work with its contents. As shown in Figure 20-9, the zipped folder's contents are listed according to file name, type, and date. The file information also shows the packed file size, the original file size, and the compression ratio. Double-clicking a program in a zipped folder runs it (as long as it doesn't require access to other files). Doubleclicking a file in a zipped folder opens it for viewing or editing.

Compressed (zipped) folders can be accessed and used like other folders

Figure 20-9. Compressed (zipped) folders can be accessed and used like other folders

While you're working with a zipped folder, you can perform tasks similar to those you can with regular folders. You can do the following:

  • Add other files, programs, or folders to the zipped folder by dragging them to it.

  • Copy a file in the zipped folder and paste it into a different folder.

  • Remove a file from the zipped folder using CUT so that you can paste it into a different folder.

  • Delete a file or folder by selecting it and clicking Delete.

You also have the option to perform additional tasks, which are unique to zipped folders. You can click File, Extract All to start the Extraction Wizard, which can be used to extract all the files in the zipped folder and copy them to a new location. You can click File, Add A Password to add a password to the zipped folder to control access to it.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset