This guide shows you how to automate Disk Cleanup in Windows Vista using the Task Scheduler.
An important part of maintaining your Windows Vista computer is routinely running a Disk Cleanup to remove the trash left behind by Windows and software on your hard drive.
Most people don’t think of or want to do things like running Disk Cleanup. This guide shows you how to setup Disk Cleanup to automatically clean your hard drive every week by using a scheduled task.
Automate Disk Cleanup
Set What to Clean Using Sageset
Before you can set disk cleanup to automatically clean your computer periodically you need to tell it what to clean when it performs a disk cleanup. Here’s how to setup disk cleanup to clean your computer based on saved settings.
- Open the command prompt by typing cmd in the search box in the Start Menu and then pressing enter.
- Type CLEANMGR /sageset:1 in the command prompt and then press enter.
Using the /sageset:1 switch saves the settings you set in the registry as :1. Disk Cleanup will use these settings when it runs from a scheduled task.
- Check off the files you want disk cleanup to clean when you run disk cleanup automatically in the Disk Cleanup Settings window.
- Click OK when you’re finished.
Setup A Disk Cleanup Scheduled Task
Now that we’ve saved settings that tell disk cleanup what to clean we can create a scheduled task that automates disk cleanup.
- Open the Task Scheduler by typing task in the Start Menu’s search box and clicking on Task Scheduler in the search results.
Note: If you don’t receive a UAC prompt when you open Task Scheduler close the Task Scheduler and open it again by right-clicking Task Scheduler and selecting Run as administrator. You also need to pay attention to part B of step 5.
- Let’s create a new folder on the left side of Task Scheduler called Disk Cleanup by expanding Task Scheduler Library, and Microsoft, and then right-click the Windows folder and select New folder. Type Disk Cleanup as the name of the new folder and click OK to save it.
- Expand the Windows folder and click on the new Disk Cleanup folder you just created.
- Let’s create a new scheduled task by right-clicking in the white space in the white box located at the top center or the Task Scheduler window and select Create new task.
- Give the new scheduled task a name by typing it in the Name box.
- Part B – If your user account you’re logged in with doesn’t have administrative privileges you must run the Task Scheduler as administrator and follow the steps in part B for disk cleanup to work.
- Click the Change User or Group button in the General tab of the Create Task window.
- Click the Advanced button in the Select User or Group window.
- Click Find Now and select the user you’re currently logged in with from the list of users and groups that show up.
- Click OK in the Select User or Group windows so that you’re back in the General tab of the Create Task window.
Test the new scheduled task you just created by right-clicking it in the Task Scheduler window and selecting Run.
Still need help? Ask your computer question now.