Gizmo's Freeware is Recruiting

Gizmos Needs YouWe are currently looking for people with skills and/or interest in the following areas:

- Digital photography software
- Windows defragmentation software

If this sounds like you then click here for more details

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 a scheduling program. In this article we will look at two: Task Scheduler  that comes free with all Windows versions from Windows 98 onwards and a rather more sophisticated freeware product called System Scheduler.

Windows Task Scheduler

Windows inbuilt scheduler is perfect for scheduling programs that don't require any keyboard inputs to run.

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. I'll use Windows XP in this example but the technique I'll describe works for Vista and Windows 7 as well though the interface for Windows Task Scheduler is a little different in each case.

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.  Click on Add a Task and 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.

System Scheduler

For more complex task scheduling my top choice is System Scheduler. It does a similar job to Windows Scheduler but additionally it allows you to enter any key-presses required  by a program in order to run.  You can do this by entering into System Scheduler a line containing the keystrokes you want to execute when the program runs.

Lets look at a practical example using DiskKeeper Lite. When you run this program you need to click a few buttons in order to start a defrag job. Usually you would use your mouse to do this clicking but you can also use keystrokes to achieve the same thing ike this:

  • Close the nag screen. This can be done from the keyboard in DiskKeeper by pressing Alt F4

  • Select the menu item "Actions."  This can be done from the keyboard by pressing Alt A
     
  • Select from the Actions menu the item "Defragment." This can be done from the keyboard by pressing the "D" key

In System Scheduler you would do this by entering the string "%{F4}%{A}D" into the "Sendkeys" field within the System Scheduler job setup panel.  Note that in System Scheduler plain keystrokes such  as "D" are entered as you would normally type them but special keystrokes such as Alt  F4 have to be entered using a code like %{F4}. Full details of these special key codes can be found in the System Scheduler help file.

The developer offers a free and a Pro version of System Scheduler. The latter has some useful additional features such as the ability to reboot and run as a service but the free will do for most folks. Furthermore, the free version covers both home and business use.

Gizmo

Share this
4.333335
Average: 4.3 (30 votes)
Your rating: None

Comments

by Anonymous on 21. June 2008 - 0:12  (#2754)

Great article, keep up the good work.

by Anonymous on 9. November 2008 - 22:53  (#10272)

Nice one, this will definetly help me.

by Anonymous on 19. January 2010 - 15:40  (#41538)

Best to leave a computer running because electronic items tend to blow out at startup. When an electric item is turned on, there is an initial surge of heat which goes through the parts.

This is easiest to see with light bulbs, it's the same reason why light bulbs normally go out when a bulb is cold and the switch is flipped on rather than just burning out while running.

by Anonymous on 3. June 2009 - 22:05  (#23008)

ok hier is my question.great post
i was wondering i run program autounpacked in task scheduler in vista but i dont know how to start it.someone told me comand line /run
but i dont know where to put it.please help

by Anonymous on 9. January 2009 - 21:57  (#13510)

cant do it. It tells me i dont have permission to run the operation. I dont have any password to login.

by Anonymous on 9. January 2009 - 23:02  (#13511)

I was not aware of this, does Ccleaner run minimized ?

by Rizar on 11. January 2009 - 2:15  (#13587)

Thanks, it works excellent in Vista too.

In Vista, you can access the Task Scheduler from Control Panel / Administrative Tools / Task Scheduler. Or it is usually located under Accessories / System Tools in the start menu.

Then select Create Task. First you create a trigger/scheduler for the task. The trigger gives you many different options, such as to run it daily at any time you want. Secondly create an action for the specific program you want to run (you add the command line /AUTO argument in this step). It is very similar to Gizmo's directions.

There is also an option to trigger the Ccleaner periodically once it begins running. For example, you could follow these steps:

(1) Go to Task Scheduler / Create Task.
(2) On the General tab: select "Run whether user is logged on..." and check "do not store password." Also check "Run with highest privileges".
(3) On the Triggers tab: Begin the task "at startup", Delay Task for 30 seconds (to prevent it failing at startup, at least for me), Repeat task every hour (or so) and for a given period of time or indefinitely, Check Activate, Check Enabled. Click "ok"
(4) Set Action as usual.

If you run CleanMem, then just mimic the settings for it. I analyzed before and after running it and it successfully cleaned even though it did not display an icon while it was cleaning.

by Anonymous on 7. April 2009 - 23:36  (#19491)

Try checking the box "run only if logged in"

by Frank Tracy (not verified) on 13. November 2010 - 8:43  (#61135)

Programs include Glary Utilities, WinPatrol, CleanMem, several Defrag utilities, Secunia PSI, Vista Services Optimizer, TweakUAC, and Ultimate Windows Tweaker. Once a week I also have my PC Automatically fix file system errors, and delay some startup programs. In addition I've implemented several tips I've found in books about Vista.

by Anonymous on 29. September 2009 - 14:22  (#33542)

Shouldn't this:
"C:\Program Files\CCleaner\ccleaner.exe /AUTO"
be:
"C:\Program Files\CCleaner\ccleaner.exe" /AUTO

On my state-of-the-art win98 machine it is, otherwise it gets changed to:
"C:\Program Files\CCleaner\ccleaner.exe \AUTO". You can try it by executing the task. If you see an icon appearing in your taskbar for a few seconds, all is well.

by Jojoyee on 30. September 2009 - 2:16  (#33570)

Thanks for pointing this out.

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

is the correct one.

Now updated in the review.

by darren (not verified) on 5. July 2011 - 14:17  (#74792)

Avast blocks download page for system starter finds trojan

by darren (not verified) on 5. July 2011 - 14:18  (#74793)

sorry system scheduler is blocked by avast

by Anonymous on 18. January 2010 - 3:41  (#41368)

I've been wanting to know how you schedule programs that require input. I just tried System Scheduler to run a complex batch job and it works great. Thanks for that one Giz. Ken.

by Anonymous on 18. January 2010 - 5:43  (#41381)

What other programs would you recommend running on windows xp, automatically?

by ianjrichards on 18. January 2010 - 10:51  (#41422)

Backup and maintenance tend to be the most common applications but some folks have particular needs such as batch email send, reminders etc.

by Anonymous on 18. January 2010 - 17:05  (#41448)

My problem is that I can't depend on XP Pro SP3 to wake up if it's in Standby mode. This is not exclusive to running Scheduler (although that's how I try to use it), it's a basic Windows problem. Have you looked into this?

by Anonymous on 18. January 2010 - 17:23  (#41449)

You should check out Autoit, a freeware auto run programme which allows recording of commands and mouse clicks, allows most window manipulation commands, and creates editable scripts.

by Bob on 18. January 2010 - 21:08  (#41470)

How well explained is that! The Gizmo Richards hallmark style.

One query:
- I've always believed it's better, as a general rule, to shut ones computer down at night so that the motherboard etc. can get some shut eye and discharge the static electricity accumulated at work. But perhaps I'm wrong. And maybe one could just schedule ones computer to shut down anyway once it's finished its night shift?

by ianjrichards on 19. January 2010 - 0:29  (#41486)

This is a moot point Bob. Some techies advise turning your PCs off, others advise leaving them running. Personally I leave my PCs running all the time and must say I have had very few hardware problems over the years.

by ianjrichards on 19. January 2010 - 0:42  (#41489)

That's a fair comment but AutoIt is a full scripting language and overkill for most simple scheduling tasks. Great product though.

by Bob on 19. January 2010 - 7:22  (#41504)

hmmm... that's interesting - thanks.

by Anonymous on 19. January 2010 - 13:59  (#41529)

My 2¢: You shuld turn off your PC if you won't be using it for a substantial amount of time. This is for two reasons: Energy savings and Security. The energy savings (although small) will add up over time and there is no more secure PC than one that is not on.

by Bob on 20. January 2010 - 3:50  (#41578)

yes, I've just been wondering whether anyone happens to know of any indicative, scientifically conducted statistical studies on the subject?

(But I wouldn't want to get off topic... let's stick to the schedule!)

by Anonymous on 22. January 2010 - 0:59  (#41722)

In the days of huge mainframes, it was quite a chore to get the beasts up and running. Most were kept running to save that time. PCs are well protected from turn-on surges so keeping them running is not a good thing as overheated parts can cause a fire if not caught in time. I wouldn't want to be away from home with my computer self-distructing.

by Anonymous on 10. February 2010 - 4:51  (#43231)

The cnet editor gave it a 5star rating, as I would, though the 2 customer reviewers didn't quite seem to know how to use it. I know that it took me several tries to get it configured correctly.

and the official website link:

http://www.airytec.com/en/default.aspx

Moderator's Comment: Download link removed. Please do not link directly to downloads. :)

by Anonymous on 1. February 2010 - 14:08  (#42549)

CClean only cleans files for the currently logged in user, right?. So, runas 'gizmo' will only clear temp files for 'gizmo' in this example? I want to clear temp files for all users.

by Anonymous on 9. February 2010 - 3:18  (#43137)

I have always had both my (Vista) computers restart every morning with a freebie called Switch Off. It has done a great job even though it was last updated in 2002 (version 2.3.0.1). In the CCleaner settings I have "Run CCleaner when the computer starts" checked. Then CCleaner does its cleaning everyday, automatically.

By the way, both my computers run as if they were brand new out of the box. Of course, I use other programs also to keep them that way.

PS I just noticed at Download.com that Switch Off was updated on 1-15-2010 (version 3.1.0.380).

by Anonymous on 15. February 2010 - 2:24  (#43643)

I forgot to mention:

To get Switch Off to run correctly I had to do several things: 1. Check "Run whether users are logged on or not." 2. Check "Run each time windows starts." 3. Make sure that in a separate startup program that Switch Off is enabled. 4. In one of those startup programs, set Switch Off to have a delayed start, otherwise it would not start automatically each day. Once I got these settings figured out, the program works great. For me, Switch Off is a must have program!

This is from my comments I left at download.com

Frank

PS I used the feature in Glary Utilities for #3 and #4 but I guess you could use programs such as Startup Delayer or WinPatrol

by Anonymous on 15. February 2010 - 5:41  (#43650)

Lastly, run Switch Off as administrator if need be. This is only needed in the newer versions as the early 2.3 version runs just fine without administrator privileges and without the delayed startup. That early version is still available at the author's website.

Post new comment

The content of this field is kept private and will not be shown publicly.