Scheduling a task
With Disk Cleanup configured properly, you can set it to run every night, by following these steps:
- Choose Start → All Programs → Accessories → System Tools → Task Scheduler.
The Task Scheduler appears. - On the right, select the Create Basic Task option.
The Create Basic Task Wizard appears. - Type a name for the task, and then click the Next button.
The wizard asks for a trigger - geek-speak for "Under what circumstances do you want the scheduled task to run. - Choose Daily if you want the cleanup to run every day, and then click the Next button.
- Set the time of day that you want the cleanup to run, and click Next.
- Choose an action. In this case, select the Start a Program option, and then click Next.
The Task Scheduler asks you for the program you want to run, cleanmgr.exe. - To run Windows 7 Disk Cleanup, click the Browse button, navigate to \Windows\System32\cleanmgr.exe, click the program once, and
click the Open button.
You can similarly run any other program with the Task Scheduler by clicking the Browse button, navigating to the program, and clicking Open. - In the Add Arguments (Optional) box, type /sagerun:9
As you probably guessed, this step tells Windows 7 Disk Cleanup to use the "number 9" parameters. - Click Next, select the Open the Properties Dialog for This Task When I
Click Finish check box, and then click the Finish button.
The Task Scheduler Wizard adds your cleanup run to its list of active tasks. You can verify it by clicking the Refresh button at the bottom of the Task Scheduler window and then scrolling through the active tasks. - In the Task Properties box, select the Run Whether User Is Logged On
or Not option, and then click OK. If prompted for a password, type it and click OK.
You have to complete this final step in the Task Properties dialog box so that the cleanup can run whether you're logged on or not.
In this tutorial:
- Maintaining Your System
- Coping with Start-Up Problems
- Creating a system repair disc
- Using the system repair disc
- Running in Safe Mode
- Working with Backups
- Restoring a file with shadow copies (previous versions)
- Maintaining previous versions on different drives
- Creating data backups
- Managing and restoring data backups
- Getting back the image backup
- Maintaining Drives
- Running an error check
- Defragmenting a drive
- Using System Restore and Restore Points
- Creating a restore point
- Rolling back to a restore point
- Scheduling the Task Scheduler
- Starting with your parameters
- Scheduling a task
- Zipping and Compressing
- Compressing with NTFS
- Zipping the easy way with Compressed (zipped) Folders
- Using the Windows 7 Resource Monitor and Reliability Monitor
- Controlling the Control Panel
- Removing and changing programs