Command line Desktop Cleanup in Windows XP
For some people, the automated Desktop Cleanup Tool is an annoying little popup that begs to be turned off. This article is not for you . . .
The Disk Cleanup Tool (aka Cleanmgr.exe) may be customized at a command line using a couple of switches, namely:
/d driveletter (selects the drive which you would like Disk Cleanup to clean.This switch is NOT used with /sagerun.)
/sageset:n (displays the Disk Cleanup Settings dialogue box. creates a registry key to store the settings you choose. the n value is any integer from 0 to 65535.)
/sagerun:n (runs the selected tasks assigned to the n value using the /sageset switch.)
***********************************************************************************************************************************************
Example:
Open a command prompt dialogue and customize the items you want cleaned up by typing:
cleanmgr.exe /sageset:24
The Disk Cleanup Settings dialogue opens allowing you to choose the categories of items to be cleaned (i.e. Setup Temp Files, etc.). Select the items then click OK.
In the command prompt now type:
cleanmgr.exe /sagerun: 24
This will run the Disk Cleanup Tool with the settings you saved previously by using the /sageset switch.
Ahhh, now the point: You can now take the command 'cleanmgr.exe /sagerun:24' and created a scheduled cleanup that runs in the background at a time which is convenient for you using the Scheduled Tasks program.
Now go clean your room!

Reader Comments