Run Programs Automatically Using Windows Task Scheduler
PCs are marvelous tools, aren’t they? They can do so much for us, but they’re hardly the user-friendly home computers promised in science-fiction, which can follow any voice command and perform self-maintenance. It would be nice, at least, if your PC could at least do some things on its own. How about automatic weekly disk defragmentation or disk cleanup?
Here’s how to use Windows’ Task Scheduler to run desired programs automatically at preset time.
An overview of Task Scheduler is in order. Open it from Start Menu > Programs > Accessories > System Tools > Scheduled Tasks. Double-click “Add Scheduled Task” to open the Wizard.
Your first step is to select the program to be run on a schedule. For this example, we’ll schedule one of MakeUseOf’s favorite Windows programs, CCleaner, to perform automatic system cleanup. Download it here.
You’ll next choose the day and time when to run the program. For a disk-cleanup tool such as this, running daily or weekly should be just fine. I’m scheduling CCleaner to run at 6:17 PM every day.
Next, name and provide the password for the Windows user account which will run the program. At the next step, select the checkbox to open the task’s advanced properties.
Now, looking at how this task is set up, not much is going to happen on schedule, except that CCleaner opens. To get CCleaner to do its thing, we’ll need to add some command-line arguments, or “switches”, to the Run line. Depending on which program you’re wishing to automate, this is where things start to get different. To find out what switches exist, if any, you may check the program’s documentation and help files, or just Google it.
For CCleaner, adding “/AUTO” to the Run line will have the program perform a disk cleanup silently and in the background, then close when done. Let’s go back to the task properties, where I’ve added the switch to the Run command.
After hitting OK, CCleaner will run on your specified schedule.
There are other solutions to run programs automatically on a specified schedule or in response to a system event. What are your own favorites? Give us some ideas in the comments.
(By) Tim Watson is a full-time student, husband, father of two, and head of Dork Lotus Enterprises. He's on Twitter @TimDub.



This is great. With the addition of a 1TB hard drive to my PC, I got quite tired of manually using Vista’s Backup and Restore Center each and every time I wanted to make a simple weekly backup without having to download some other third party app. The answer? Automate it with Task Scheduler! I used this guide
http://maximumpcguides.com/windows-vista/schedule-a-complete-pc-backup/hello!
with regard to defrag?
every how many days should be done?
the command does not work with defragmentation: C: \ Program Files \ Defraggler \ Defraggler.exe / AUTO
I’d recommend doing it about once a month.
Remember about space in command line
As familiar as I am with Task Scheduler and CCleaner, I never thought about using them together. This is an excellent tip which gives me other ideas due to the fact that I am a clean freak when it comes to my computer(s).
Keep up the good work.
Well I tried it in Vista, I don’t know if its the same, but if you could write one for Vista that would be awesome. But I hope it’s the same and I hope it will work!
I only going to run CCleaner once a week.
I may be wrong, but unless the writer is using a theme in XP, those screen shots look very much like Vista windows.
You are wrong
It is Most likely Windows XP Pro. Windows Vista has a completely different interface. Plus windows Vista Task Scheduler is 100 percent different, so that gives it away also. Plus there are no Vista Icons, those are all XP Icons.
(Comments wont nest below this level)Don’t worry, I don’t mind being wrong once in a while. I have not being around a Vista machine in about a month, so I guess it’s easy to forget what things look like…
Don’t worry either, I understand, one of my good friends had never used Vista before and right now is just currently starting to use Vista and when switches to Vista I will be switching to Windows 7, hahaha. I can’t go back to using XP anymore, just can’t It is impossible.