Recipe 7.7. Cleaning Up a Volume


Problem

You want to clean up unused or unneeded files on a volume to reclaim space.

Solution

Using a graphical user interface

  1. Open Windows Explorer.

  2. Right-click the drive you want to clean up and select Properties.

  3. Click the General tab if it doesn't open by default.

  4. Click the Disk Cleanup button. Depending on the size of the volume you are scanning, cleanup can take a while to complete.

  5. Under Files to delete, check the boxes beside the type of files you want to remove.

  6. When you are done with your selections, click OK.

  7. Click Yes to confirm that you want to delete the files.

Using a command-line interface

You can launch the Disk Cleanup tool from the command line by running the following command:

> cleanmgr

To target a specific drive, use the /d option:

> cleanmgr /d E:

You can automate the Disk Cleanup tool to run against all the drives on a system in a couple of steps. First, you need to configure the types of files you want to clean up. Run the cleanmgr utility with the /sageset: option followed by an integer. The integer represents a Disk Cleanup profile. In the following example, we'll use 1:

> cleanmgr /sageset:1

This opens the Disk Cleanup Settings property page. Under Files to delete, check the boxes beside the types of files you want to clean up. Click OK when you are done. Now, use the /sagerun: option followed by the same number we just used (in this case 1):

> cleanmgr /sagerun:1

This command enumerates all drives on the system and performs a disk cleanup according to the profile you just created.

Discussion

Disk Cleanup is a tool to help you remove unneeded files from your system, files that are doing nothing more than taking up space. It can find temporary files used by Internet Explorer and old setup files for applications such as Microsoft Office and let you delete them.

After you've analyzed a particular volume, you can click on a file type, such as Temporary Internet Files, and a description of that file type will appear at the bottom of the dialog box. As you check or uncheck boxes, you'll see the number beside Total amount of disk space you gain increase or decrease, respectively. Depending on the file type, a View Files button will be displayed, which when clicked opens a Windows Explorer window to the location of the files. The list of file types will vary depending on the volume you are looking at. Only file types that apply to a particular volume are displayed.

The Compress old files option is a good way to minimize disk bloat over time. When enabled, it will compress files that haven't been accessed in a certain number of days. It won't delete any files, just compress them. That means files you rarely access are compressed and the impact to the disk is minimized.

The More Options tab provides buttons for opening the Windows Components and Add/Remove Programs screens and a button for removing all but the most recent system restore point. Depending on how much space you need to reclaim, all three of these can be good sources for reclaiming unused or rarely used disk space.

See Also

MS KB 253597, "Automating Disk Cleanup Tool in Windows," and MS KB 310312, "Description of the Disk Cleanup Tool in Windows XP"



Windows XP Cookbook
Windows XP Cookbook (Cookbooks)
ISBN: 0596007256
EAN: 2147483647
Year: 2006
Pages: 408

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net