Run Programs Automatically Using Windows Task Scheduler

Apr. 26th, 2009 By Tim Watson

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.

run programs automatically

windows task scheduler

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.

how to run programs automatically

image

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.

image

image

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.

image

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.

image

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.

image

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.

Enjoyed the article? Subscribe to MakeUseOf to get daily updates on new cool websites and programs in your email for free. You'll also get free printable cheat sheets to your favorite programs

Your Email:

Add MakeUseOf to:



10 Comments Add Comment
2009-04-27 00:26:37

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/

2009-04-27 03:16:25
Alessandro
Subscribed to comments via email

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

2009-04-28 06:33:57

I’d recommend doing it about once a month.

2009-04-28 06:25:20
guru

Remember about space in command line

2009-04-28 22:02:41

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.

2009-04-29 08:02:21
Subscribed to comments via email

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. :P

2009-04-29 11:28:56

I may be wrong, but unless the writer is using a theme in XP, those screen shots look very much like Vista windows.

2009-04-29 12:16:45
Subscribed to comments via email

You are wrong :P 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)
2009-04-29 13:26:12

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… :-)

2009-04-29 15:05:51
Subscribed to comments via email

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.

Reply

You may use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> in your comment.