cleanmgr
Clears unnecessary files from your computer's hard disk. Windows commands reference
On Windows File cleanmgr.exe
Windows
Clears unnecessary files from your computer's hard disk. You can use command-line options to specify that Cleanmgr cleans up Temp files, Internet files, downloaded files, and Recycle Bin files. You can then schedule the task to run at a specific time by using the Scheduled Tasks tool.
cleanmgr [/d <driveletter>] [/sageset:n] [/sagerun:n] [/TUNEUP:n] [/LOWDISK] [/VERYLOWDISK]
To run the Disk Cleanup app so that you can use its dialog box to specify options for use later, saving the settings to the set 1, type the following
cleanmgr /sageset:1Identify/sagesetDisplays the Disk Cleanup Settings dialog box and also creates a registry key to store the settings that you select. Windows commands referenceTo run Disk Cleanup and include the options that you specified with the cleanmgr /sageset:1 command, type
cleanmgr /sagerun:1Identify/sagerunRuns the specified tasks that are assigned to the n value if you use the /sageset option. Windows commands referenceTo run cleanmgr /sageset:1 and cleanmgr /sagerun:1 together, type
cleanmgr /tuneup:1Identify/tuneupRun /sageset and /sagerun for the same n. Windows commands reference/d <driveletter>Specifies the drive that you want Disk Cleanup to clean.
NOTE: The /d option isn't utilized with /sagerun:n./sageset:nDisplays 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 9999. For more information, see Registry key information./sagerun:nRuns the specified tasks that are assigned to the n value if you use the /sageset option. All drives on the computer are enumerated and the selected profile runs against each drive./tuneup:nRun /sageset and /sagerun for the same n./lowdiskRun with the default settings./verylowdiskRun with the default settings, no user prompts./autocleanAutomatically deletes the files that are left behind after you upgrade Windows./?Displays help at the command prompt.Windows
Clear unnecessary files from the computer's hard disk. Note: This command is deprecated in newer Windows versions, use "Storage Sense" instead.
Open Disk Cleanup for a specific drive
cleanmgr /d CIdentify/dSpecifies the drive that you want Disk Cleanup to clean. Windows commands referenceOpen Disk Cleanup with all options selected by default
cleanmgr /d C /lowdiskIdentify/dSpecifies the drive that you want Disk Cleanup to clean. Windows commands reference/lowdiskRun with the default settings. Windows commands referenceClean up all files automatically without user prompts
cleanmgr /d C /verylowdiskIdentify/dSpecifies the drive that you want Disk Cleanup to clean. Windows commands reference/verylowdiskRun with the default settings, no user prompts. Windows commands referenceConfigure which files to clean and save the settings to a specific profile
cleanmgr /sageset:profile_numberIdentify/sagesetDisplays the Disk Cleanup Settings dialog box and also creates a registry key to store the settings that you select. Windows commands referenceRun Disk Cleanup using a previously configured profile
cleanmgr /sagerun:profile_numberIdentify/sagerunRuns the specified tasks that are assigned to the n value if you use the /sageset option. Windows commands referenceClean up files left after a Windows upgrade
cleanmgr /autocleanIdentify/autocleanAutomatically deletes the files that are left behind after you upgrade Windows. Windows commands referenceClean up files from a previous Windows installation
cleanmgr /setupIdentify