ProblemYou want to clean up unused or unneeded files on a volume to reclaim space. SolutionUsing a graphical user interface
Using a command-line interfaceYou 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. DiscussionDisk 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 AlsoMS KB 253597, "Automating Disk Cleanup Tool in Windows," and MS KB 310312, "Description of the Disk Cleanup Tool in Windows XP" |