none
Windows 7 Cleanmgr.exe command line switches

    Question

  • I am trying to find more information on the command line switches for Disk Cleanup (cleanmgr.exe) in Windows 7. When I run cleanmgr /? from a command prompt, it returns with the following switches: cleanmgr /SAGESET:n /SAGERUN:n TUNEUP:n /LOWDISK /VERYLOWDISK /SETUP. I am familiar with SAGESET and SAGERUN but would like to know a little more about the rest.

    Thx,

    Scott St. Gelais

    Saturday, August 20, 2011 4:33 PM

Answers

  • OK. Let's go into a bit more detail. We shall split the switches into related groups.

    First of all, we have /SAGESET:n, /SAGERUN:n, and TUNEUP:n where n is a number between 1 and 65535

    /SAGESET:n This command allows you to set your cleanup options, and save that configuration in the registry referenced by n. It does not execute the cleanup itself, as all it does is store the selected options. If the reference n already exists, the configuration referenced by it is modified and the new settings are saved.

    /SAGERUN:n This command actually executes the cleanup operation that was previously set by the above command. If n doesn't exist, a cleanup operation is performed using the default settings.

    TUNEUP:n This switch is, in effect, a combination of the above switches. It firstly modifies the cleanup settings referenced by n (or, if n doesn't exist, creates them) and then executes the cleanup operation.

    Secondly, /LOWDISK and /VERYLOWDISK

    /LOWDISK This command is implied by default if no switches are specified. It runs the disk cleaner in much the same way as it would if you were to run it from the Disk Cleanup shortcut via Start > All Programs > Accessories > System Tools > Disk Cleanup

    /VERYLOWDISK This command is  usually run automatically when disk space runs low, and is, in essence, an automated version of the previous command. You can run it explicitly, if you wish, but it just performs the cleanup using the default settings without any user input.

    Thirdly, /SETUP

    /SETUP I haven't been able to find anything on this switch, so I can only surmise that it is a specialized switch that just cleans up any setup log files.



     

     

    • Proposed as answer by pkn2011 Monday, August 22, 2011 7:11 PM
    • Marked as answer by geeksinphoenix Monday, August 22, 2011 10:02 PM
    Monday, August 22, 2011 6:23 PM

All replies

  • This article should explain everything. http://www.rawcomputing.co.uk/windows7/win7tips69.html

    • Proposed as answer by Dwarf63 Sunday, August 21, 2011 6:38 PM
    Sunday, August 21, 2011 6:38 PM
  • This article should explain everything. http://www.rawcomputing.co.uk/windows7/win7tips69.html

    While this article is quite informative, it doesn't explain the use of the TUNEUP integer and there is nothing about the /SETUP switch.
    Monday, August 22, 2011 3:17 AM
  • OK. Let's go into a bit more detail. We shall split the switches into related groups.

    First of all, we have /SAGESET:n, /SAGERUN:n, and TUNEUP:n where n is a number between 1 and 65535

    /SAGESET:n This command allows you to set your cleanup options, and save that configuration in the registry referenced by n. It does not execute the cleanup itself, as all it does is store the selected options. If the reference n already exists, the configuration referenced by it is modified and the new settings are saved.

    /SAGERUN:n This command actually executes the cleanup operation that was previously set by the above command. If n doesn't exist, a cleanup operation is performed using the default settings.

    TUNEUP:n This switch is, in effect, a combination of the above switches. It firstly modifies the cleanup settings referenced by n (or, if n doesn't exist, creates them) and then executes the cleanup operation.

    Secondly, /LOWDISK and /VERYLOWDISK

    /LOWDISK This command is implied by default if no switches are specified. It runs the disk cleaner in much the same way as it would if you were to run it from the Disk Cleanup shortcut via Start > All Programs > Accessories > System Tools > Disk Cleanup

    /VERYLOWDISK This command is  usually run automatically when disk space runs low, and is, in essence, an automated version of the previous command. You can run it explicitly, if you wish, but it just performs the cleanup using the default settings without any user input.

    Thirdly, /SETUP

    /SETUP I haven't been able to find anything on this switch, so I can only surmise that it is a specialized switch that just cleans up any setup log files.



     

     

    • Proposed as answer by pkn2011 Monday, August 22, 2011 7:11 PM
    • Marked as answer by geeksinphoenix Monday, August 22, 2011 10:02 PM
    Monday, August 22, 2011 6:23 PM
  • When I opened cleanmgr.exe with Process Explorer I found two more hidden switches, /HELP & /USAGE. When I used these switches, I got the same dialog box as /?. I'm kind of thinking that the /SETUP switch might be for adding the location of temp files of any new software installations.
    Monday, August 22, 2011 10:02 PM