Automate Disk Cleanup in Windows 7

Set Disk Cleanup to automatically clean your computer annually in Windows 7.

Automate Disk Cleanup

Setting Disk Cleanup to automatically clean the computer takes a series of steps. First you’ll have to tell Disk Cleanup what to delete, and then you’ll need to schedule when Disk Cleanup should run.

Configure Disk Cleanup

First we need to tell Disk Cleanup what to remove and save those settings so that it knows what to delete when we schedule it to run later.

  1. Open the command prompt by typing cmd in the Start Menu’s search box and then press Enter on the keyboard.
  2. Type cleanmgr /sageset:1 in the command prompt and then press Enter.

  3. Check the categories of files you want Disk Cleanup to automatically delete and then click OK.

    Hint: For a complete list of what each category of files are, check out our guide on using Disk Cleanup.

Schedule Disk Cleanup

Second we need to schedule Disk Cleanup to run periodically and clean up the computer based on the settings you just gave it.

  1. Open the Task Scheduler by going to All Programs in the Start Menu, Accessories, System Tools, and then click Task Scheduler.
  2. Select Create Basic Task in the right column of the Task Scheduler.

  3. Give the new task a name and then click Next.

  4. Set how often you want to run Disk Cleanup (I recommend monthly) and then click Next.

  5. Select the details of when you want Disk Cleanup to run (I set it to run at 8:30 on the first of every month) and then click Next.

  6. Select to Start a program and then click Next.

  7. Click the Browse button, find the program named cleanmgr, and double-click it.
  8. In the arguments box add the argument /sagerun:1 and then click Next.

  9. Review all the settings and then click Finish.

You’re done! Now Disk Cleanup will automatically clean your computer on a schedule.

Still need help? Ask your computer question now.

Related Guides:

Leave a Reply

Subscribe to this guide's comments RSS feed.

Microsoft Windows is a registered trademark of Microsoft Corporation. Microsoft Corporation in no way endorses or is affiliated with All other products mentioned are registered trademarks of their respective companies. MAXIMUMpcguides IS NOT RESPONSIBLE for any damage or data loss to your computer from using this web site. All information on MAXIMUMpcguides is provided on an AS IS basis with NO WARRANTIES.

Copyright 2006-2019 Brent Trahan. All rights reserved.