Windows Disk Cleanup utility is a great tool for cleaning up multiple locations on your Vista or XP Computers. The one drawback to the utility is that you need to configure it every time you want to cleanup your disk drives.
Instead, you can easily pre-configure specific tasks for Disk Cleanup to use and create a shortcut on the Desktop to run it at any time.
In order to create a customize configuration for Disk Cleanup, we need to run the utility using the sageset option. This option allows you to configure the Cleanup utility, and save it, so we can run it later with the custom configuration.
To get started, open the Run window by clicking on Start \ Run… and type:
cleanmgr.exe /d c: /sageset:1
cleanmgr.exe = executable for Disk Cleanup utility.
/d c: = is the drive letter we want to use, and since it contains the Windows installation, will have all available options. (NOTE: see more information below about multiple drives)
/sageset:1 = used to create the registry key for storing the configuration.
NOTE: Following screen shots are from Vista Disk Cleanup Utility. XP cleanup will look similar but with less options.
Now make any selections by checking each item you want to cleanup. When finished, click OK.
Next, go to your Desktop, right click and select New \ Shortcut. Then enter the following command in the "Type the location of the item:"
Click next and give the shortcut a name, such as "Quick Clean Up" (do not use quotes). Now when you want to run the customized configuration for Disk Cleanup, you can just double click on the shortcut.
If you are wondering, the /sagerun:1 option tells Disk Cleanup which configuration to use. So that means you can create different configurations (such as cleanup the trash, or cleanup temp and setup log files) by specifying the number with the /sagerun variable.
But I Have Multiple Drives?
Unfortunately, when Disk Cleanup runs, all drives are cleaned (regardless of the number of drives you have) with each run. While you cannot choose which drive to clean, specifying the drive letter when creating a configuration allows you to choose only the options that are available on that drive.
For example, if you have an E:\ drive, use:
cleanmgr.exe /d E: /sageset:2
and configure the tasks for Disk Cleanup to use on the E:\ drive. Options that only pertain to that drive should only be available.
Even though the custom configuration will also clean the same selections on the C:\ drive, you can tailor the configuration to only what is available on the E:\ without just selecting everything.
When finished, you can either create another shortcut on your Desktop using the following command:
Or create one shortcut to run both cleanup tasks which will basically combine the selections into one automatic cleanup.
cleanmgr /sagerun:1 /sagerun:2
Now you can cleanup your Computer with custom configurations set to your preferences automatically.