How to Schedule Programs to Run Automatically

It's often very handy to be able to schedule tasks to run unattended. The classic example is backup. I backup my key data each night at 2.00 a.m. and thankfully I don't have to be there to make it happen. Instead it takes place automatically using the task scheduler built into the backup program.

However, not all programs have an inbuilt task scheduler. In these cases it's still possible to run the program using the Windows Task Scheduler that comes free with all Windows versions from Windows 98 onwards. In fact, many programs that have automatic scheduling make use of the Windows Task Scheduler to do the real work.

Let's explore the use of Windows Task Scheduler by setting up an automated daily task to clean all the junk files off your hard drive.

The program we will use to do the cleaning is the excellent free utility CCleaner. If you don't have a copy, go grab it now from here: http://www.filehippo.com/download_ccleaner/

After downloading, install the program on your PC. During the installation make sure you un-check the option to install the Yahoo Toolbar, unless, that is, you really want it. After installing CCleaner start the program and check the default cleaning options to make sure these are what you want. For example, if you want to retain your browser history and auto-complete make sure those boxes are unchecked. Once you are happy with the options, shut down CCleaner.

Now start up the Windows Scheduler by clicking Start / Control Panel / Scheduled Tasks / Add Scheduled Task. This will start the Scheduled Task Wizard. Click <Next> and this will bring up a list of programs. Select CCleaner then <Next>. Then select Daily and <Next>. Then whatever time you want the program to automatically run and <Next>. After that, enter your username and passwords followed by <Next>. Don't click <Finish> just yet.

Now we need to use a little trick. If you stop at this point CCleaner will run automatically at the prescribed time but won't actually do any cleaning. It will be just sitting there waiting for you to press some buttons.

To get around this you need to tell CCleaner to run without any user intervention. Thankfully the folks at CCleaner have provided a special command line option to do this.

To add the command line option, check the "Open advanced properties" box in the Task Scheduler Wizard and then <Finish>. In the "Run" box you should have something that looks like this:

"C:\Program Files\CCleaner\ccleaner.exe"

Now click at the end of this line just after the .exe, leave a space and then type in /AUTO so the complete line now looks like this:

"C:\Program Files\CCleaner\ccleaner.exe /AUTO"

The /AUTO tells CCleaner to run automatically once started and exit automatically when finished which is exactly what you want.

Well that's it! You've now created a scheduled job that will clean your hard drive of unwanted files every night.

If you want to create other scheduled jobs such as backup or defragging your hard drive you can do so in the same way. Unfortunately, not all programs have command line options like CCleaner that allow automatic running without user input. For these programs to run automatically you need a program that can automate the entry of keystrokes. There are many such programs available, including some excellent free programs such as this one.

Great article, keep up the good work.

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <b> <address> <blockquote> <br> <caption> <center> <code> <dd> <del> <div> <dl> <dt> <em> <font> <h2> <h3> <h4> <h5> <h6> <hr> <i> <img> <li> <ol> <p> <pre> <span> <strong> <sub> <sup> <table> <tbody> <td> <tfoot> <th> <thead> <tr> <u> <ul> <tr>
  • Lines and paragraphs break automatically.

More information about formatting options