Windows 7 / Getting Started

Scheduling a task

With Disk Cleanup configured properly, you can set it to run every night, by following these steps:

  1. Choose Start → All Programs → Accessories → System Tools → Task Scheduler.
    The Task Scheduler appears.
  2. On the right, select the Create Basic Task option.
    The Create Basic Task Wizard appears.
  3. 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.
  4. Choose Daily if you want the cleanup to run every day, and then click the Next button.
  5. Set the time of day that you want the cleanup to run, and click Next.
  6. 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.
  7. 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.
  8. 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.
  9. 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.
  10. 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.
[Previous] [Contents] [Next]