Automated Disk Cleanup (Cleanmgr.exe)
Anybody with a smaller hard drive will want to use this to help keep their systems clean. It can also give performance boosts in the more extreme cases of system neglect.
/sageset:n - This switch displays the Disk Cleanup Settings dialog box and creates a registry key to store the settings you select. The n value is stored in the registry and allows you to specify different tasks for Disk Cleanup to run. The n value can be any integer value from 0 to 65535. To get all the available options when you are using the /sageset switch, you may need to specify the drive letter that contains the Windows installation.
Available Options to cleanup (as of XP Pro SP2):
Temp Setup Files
Downloaded Program Files
Temp Internet Files
Debug Dump Files
Office Setup Files
old chkdsk files
Recycle Bin
Temp Remote Desktop Files
Setup Log Files
Temp Files
WebClient temp files
Compress Old Files
Catalog files for content Indexer
/sagerun:n - This switch runs the specified tasks that are assigned to the n value by using the sageset switch. All drives in the computer will be enumerated, and the selected profile will be run against each drive.
For example, in Scheduled Tasks, you could run the following command after
running the cleanmgr /sageset:11 command: cleanmgr /sagerun:11
This command runs Disk Cleanup with the options that were specified with the
cleanmgr /sageset:11 command.
The article from MS can be found
here.