UniteInnovations

Home / Blog / Tutorials

Automate Run Disk Cleanup with Task Scheduler

Why Run Disk Cleanup

Disk cleanup removes unnecessary files from your hard drive and this includes temporary internet and system files and empty the recycle bin and does a lot more and

Why Automate Disk Cleanup

It is very easy to forget to run this simple but important task. By it running automatically on a schedule, you won’t have to worry about forgetting to run it manually.

Here are The Steps

  1. Begin by going to the start menu and in the search box type CMD
  2. When a command prompt icon appears right click on it and choose to run as administrator.

I know the command prompt can be intimidating to beginners but this is a very easy process to run and you shouldn’t have any problems with it.

  1. At the command line type cleanmgr.exe /sageset:20

You’ll see a the disk cleanup window appear with a long list of files to remove when you run disk cleanup. If you click on each of them, a description of the selection will appear down the bottom.

  1. Make your selections and click okay.
  2. Close a command prompt.
  3. Go back to the start menu and this time type in task on task scheduler should appear in the list.
  4. Once again right click on task scheduler and choose to run as administrator, then continue.
  5. Task schedule window will open showing the status of previously run task.
  6. Next go to task scheduler Library. Here shows tasks that are scheduled to run. We’re going to add to this.
  7. Go to create basic task on the right actions pane.
  8. Name the new task “disk cleanup”, or what ever you’d like. I leave the description blank.
  9. Click next.
  10. For this example we’re going to schedule to run weekly but you can have it run anytime you want. You can run daily, monthly, one time when a computer starts, when I log off, or when a specific event is logged.
  11. Next, leave today’s date but there is a drop down where you can choose a date for the task to start.
  12. Then select when the task recurs and on what day. I’m going to have it run once a week every Friday. Click next.
  13. The action is to start a program. Next.
  14. Search for the executable. Click browse and in the search box type cleanmgr The cleanmgr.exe should appear. Double click on it.
  15. Under add arguments C: /sageset:20
  16. Leave starting options blank, click next.
  17. Review the task summary. Make sure everything is how you’d like it to be.
  18. This is very important. Check “open the properties dialog for this task when I click finish” and then click finish.
  19. Then check the box “run with highest privileges”, click OK.

That’s how you schedule disk clean up to run regularly and automatically.