NWA-PCUG Newsletter Article, December 2008
Using Vistaís Hidden Disk Cleanup Options
by Vinny La Bash,
Member of the Sarasota Personal Computer Users Group, Inc., Florida

vlabash(at)comcast.net (click to email author)

Obtained from APCUG with the author's permission for publication by APCUG member groups.

There are many things to like about the disk cleanup utility in Windows Vista. Itís built into the operating system, it works, and itís free. Itís also a tool that removes many potential problems such as corrupt files that may be causing difficulties or could cause computer ills in the future. One of its minor shortcomings is that it doesnít detect and eliminate wasteful duplicate files. This is a very insignificant quibble as Microsoft never claimed it could do that in the first place. That ability is an item on my wish list for the next version. Overall itís a very useful tool that everyone should be familiar with.

There is more to Disk Cleanup than removing junk files and recovering gigabytes of disk space. Itís amazing how Ďtemporaryí files can hang around for months in the little used crannies of a disk drive. Poorly written install and uninstall routines are largely responsible, but software glitches and power hiccups leave their own share of digital detritus laying about.

Systems with more than a terabyte of storage are becoming common, and itís easy to lose track of even the largest files. Try locating a suitcase sized patch of land in an area with the dimensions of a football field and youíll have an idea of what Iím talking about. Aside from taking up space, these useless files can slow down searches, bloat your backups, and make Vistaís slow defrag process even slower.

If youíre not familiar with how Disk Cleanup works, you can access a good tutorial by clicking the Start icon, and then Help and Support. In the search box type Disk Cleanup, and you will get a list of items directly and indirectly related to the subject. You want the first three or four items in the list.

Letís access the normal version of Disk Cleanup by opening up the Computer icon on the Desktop, right-clicking the C: drive, and choosing Properties.

On the General tab locate the Disk Cleanup button just below and to the right of the disk graphic. You might want to make a note of how much used and unused disk space you have for a before and after comparison. Left-click on the Disk Cleanup button and you will get a message that Windows is doing some calculations. Eventually, you get a dialog box which displays various categories of files you can remove. Windows will let you peek at many of these files, but itís largely a waste of time. Iíve never found anything worth examining. Make a note of how many types of files Windows can remove, and then close all the dialog boxes.

Youíve just seen the standard way to access Disk Cleanup. Letís now ecamine Disk Cleanup with its deep cleaning options exposed. Vistaís official file name for the Disk Cleanup utility is cleanmgr. Open the Start globe again and type cleanmgr on the Start Search box at the bottom of the menu. Press Enter and The Drive Selection dialog box appears. This is a great way to eliminate mouse clicks if we want a fast way of getting to a specific drive. However, this method doesnít display the extra functions weíre looking for so close the dialog box down.

To access the enhanced options we need to use something called the System Agent or sage in conjunction with cleanmgr. Click the Start globe again and in the Start Search box type

Cleanmgr /sageset:1

Notice the space between cleanmgr and the forward slash. Sageset is a variation of the System Agent utility, and the number 1 allows you to select different cleaning options. You can use any number you want, even zero or negative numbers.

Disk Cleanup will now be running in a special setup mode that offers more cleaning options than the standard default. In addition, the System Agent will remember whatever cleanup options you select. When you run Cleanup again you donít have to make the same selections as long as you use the same number. Thatís what the System Agent set part does.

Press Enter to run the utility and wait for the Disk Cleanup Settings dialog box to appear. Highlight the individual cleanup options and in some cases there is additional information that is missing from the default dialog box. You also have more cleanup options.

You can select any number of options from just one to all of them. For maximum cleaning, select everything. When youíre satisfied with the options youíve selected, click the OK button and run the utility. When the job is done, go back and see how much disk space youíve recovered. You could be in for a pleasant surprise.

We used the sageset command to set the cleanup options. The system keeps track of what youíve done, and it will run the utility according to your specification in the future, but you canít use the sageset command for that. You need to ignore sageset and run the sagerun command instead. From the desktop click the Start globe, and in the Search box type:

Cleanmge /sagerun:1

Press Enter and the system will automatically run in enhanced mode with the preference previously recorded. Run this command anytime you wish from now on. You can always change preferences by rerunning the sageset command with the cleanmgr utility.

Chances are good that a lot of clutter will be removed from your system, and you will see an increase in free space on your system. If you wish to automate the process, you can use the Task Schedular to run the tool automatically at your convenience.

This article has been provided to APCUG by the author solely for publication by APCUG member groups. All other uses require the permission of the author (see e-mail address above).

Click here to return to top