How to Automate the Disk Cleanup on a Domain
- 1). Click the Windows "Start" button, click "Control Panel" and then click "System and Security." Click "Administrative Tools" and then double-click "Task Scheduler."
- 2). Click the "Action" menu item at the top of the window and then click "Create Basic Task." This starts the scheduler for Disk Cleanup.
- 3). Type a name for your scheduled task such as "Disk Cleanup Schedule" and click "Next." Select how often you want to run Disk Cleanup. Weekly or monthly is sufficient for most users. Click "Next."
- 4). Click "Start a program" and click "Next." The next window asks for the program you want to start. Enter "cleanmgr.exe" into the text box. Click "Next."
- 5). Review the summary of the Disk Cleanup scheduled task. Click "Finish" to save the automated schedule and close the wizard.
Source...