Create Customize Shortcut For Running Windows Disk Cleanup


winlogo.jpgWindows 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:"

cleanmgr /sagerun:1


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?

Unfortunantly, 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, specifing 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:

cleanmgr /sagerun:2

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.



Comments on Create Customize Shortcut For Running Windows Disk Cleanup Leave a Comment

February 15, 2008

Cor'e =) @ 8:19 pm #

I did this, but i got very buggy results:

Two Runs:
cleanmgr /d c: /sageset:1
cleanmgr /d g: /sageset:2


Created Two Shortcuts:
%windir%\system32\cleanmgr.exe /sagerun:1
%windir%\system32\cleanmgr.exe /sagerun:2

Now running either shortcut actually runs CleanUp for BOTH(!) Drives C: & G: rather than just the single drive letter alone!

What's Up??? Does not work as advertised.

February 16, 2008
April 11, 2008

Lipjam @ 3:50 am #

I scheduled a disk cleanup on Server 2k and expected it to be done overnight but when I got in the next morning I was met with a dialog box asking me to select the drive I wished to clean? I thought this program just cleaned all drives. What's the story?

July 1, 2009

woodsman @ 10:12 pm #

this is stupid only and idiot would do this this is completely unnecessary
simply open start menu go to search box type in disk cleanup
when the file comes up in your search you right click on it and click create shortcut and bam you are done

July 2, 2009
March 30, 2010

Barisal @ 12:50 pm #

Thanks for this very useful topic. I've found what the exact thing (custom setting) which I couldn't find in Microsoft's page.

September 27, 2010

Alan Grill @ 8:43 am #

I did find this helpful but it isn't quite working. It did not clean out either the c:\tmp or c:\windows\tmp folders. I am not sure about the Temporary Internet files.

Leave a Comment

Fields marked by an asterisk (*) are required.

Subscribe without commenting