≡ Menu

Disk cleanup manager run command

We can launch disk cleanup tool from Run window by executing the command cleanmgr.

There are two command line switches that cleanmgr command accepts. These can be used to automate the disk cleanup task. These two switches are /sageset and /sagerun.

To perform unattended disk cleanup we need to perform the following steps.

1. Create disk cleanup settings by running the following command

cleanmgr /sageset:numeric_id


cleanmgr /sageset:1

This will launch disk cleanup tool. Now you need to select the categories of files you want to delete. Click on ‘OK’ button after selecting the items.

2. Now whenever you want automated disk cleanup, you just need to run the below command.

cleanmgr /sagerun:id


cleanmgr /sagerun:1

This works on Windows XP, Vista, Windows 7, Server 2003 and Server 2008 operating systems.

2 comments… add one
  • raker

    for, cleanmgr /sagerun:1
    does the number represent a predfined setting?
    Like i just want to delete, temp Setup Files, temp. internet files, recycle bin,temporary files..stuff like that,

    No need to have the system check for previous O/S or other stuff.

    • raker

      i found it,

      /sageset: n – This option displays the Disk Cleanup Settings dialog box and also creates a registry key to store the settings that you select. The n value, which is stored in the registry, allows you to specify tasks for Disk Cleanup to run. The n value can be any integer value from 0 to 65535. To have all of the options available when you use the /sageset option, you might need to specify the drive where Windows is installed.

      then run the value you made up, i.e. sagerun:11, so run “cleanmgr /sagerun:11”

Leave a Comment