The Task Scheduler has been a part of Windows for a very long time. While it has always been kind of a crude tool, Microsoft gave it a much needed overhaul in Windows Vista. Let's take a look at Windows Task Scheduler's new capabilities.
The Task Scheduler in Windows has always required an administrator to provide two basic types of information: a trigger and an action. A trigger is the event that kicks off an action. In the past, a trigger has always been a timed event. For example, if you configured the Windows Task Scheduler to perform a certain action at 3:00 p.m., then the arrival of 3:00 would be the trigger that would launch the specified action.
In the Windows Vista version, timed triggers still exist, but Task Scheduler is no longer limited to using these types of triggers exclusively. There is now a variety of triggers it can respond to. For example, a particular entry in the event log can act as a trigger, and Task Scheduler can launch an action in response. The action can be anything from running an executable file to restarting a service or sending an email message.
A new component to a scheduled task is the ability to stipulate conditions. You might, for instance, set a condition that a task should only be performed if the computer is not running off a battery. Another example might be running a task only when the computer is idle.
The primary interface to Windows Task Scheduler is the Task Scheduler console, which you can access through the control panel by clicking on the Administrative Tools icon, followed by the Task Scheduler icon. When the Computer Management console opens, you'll find the Task Scheduler beneath the System Tools folder. Figure A shows what the console looks like.
As the figure illustrates, several tasks are set up by default. These tasks are related to various system maintenance functions, but it's easy to create your own tasks for virtually any purpose. There are two types of tasks you can create: regular and basic. While basic tasks are a little bit easier to configure, they give you fewer capabilities than regular tasks.
To create a basic task, click the Create Basic Task link found in the actions pane. Upon doing so, you will be prompted to enter a name for the task that you're creating. This screen also gives you the opportunity to enter a description of what the task does.
After naming the task, click the Next button and you'll be taken to the screen that's shown in Figure B, where it asks when you want the task to start. You can link the task to a timed trigger and set it to launch when the computer starts or you log in or when a specific event is logged.
After choosing the task trigger, click Next and you will see a screen asking you for more information about the trigger, as shown in Figure C.
Note: Keep in mind that this screen capture is just an example. The actual contents of the screen vary considerably depending on the type of trigger you've chosen.Figure C (click to enlarge)
At this point, the wizard will prompt you as to what type of action you want to take when the task is triggered. As you can see in Figure D, you can choose to launch a program, send an email message or display a message.
Just as you had to give more specific information about the type of trigger, you must also provide additional info about the type of action you want carried out. If you look at Figure E, you can see the screen that is displayed when you choose to send an email message, for example.
Click Next followed by Finish to create the task. Once again, these basic tasks are somewhat limited in their capabilities. If you want some more flexibility, create a regular task by clicking the Create Task link found in the actions pane. Windows Vista will then display the Create Task properties sheet, shown in Figure F.
The Create Task properties sheet has a lot of the same options as the basic task wizard, but with some important differences. In Figure F, you can see that the properties sheet's General tab gives you the option of running the task only when a user is logged in. You also have the option of hiding tasks or running them with the highest privileges.
The properties sheet's Triggers tab allows you to define the circumstances for the trigger. Take a look at Figure G. The thing that makes this different from the Create Basic Task Wizard is that you can define multiple triggers for a single task. Likewise, the Actions tab allows you to specify multiple actions that are performed when the task is triggered.
The Conditions tab gives you options that aren't available through the Basic Task Wizard. In Figure H, for instance, the tab gives you the option of only starting the task if the computer is idle. You can also take the computer's power state and network connectivity into account when determining whether or not to perform a triggered action.
The last tab of the properties sheet is the Settings tab, shown in Figure I. It allows you to set a few more basic settings, such as whether you want to allow the task to be run on demand and at what point the task should be terminated.
Windows Vista Task Scheduler is much more sophisticated than the one that comes with previous versions of Windows. The new Task Scheduler console provides a good balance between creating simplified tasks and getting a great deal of control over the tasks that you're creating.
|Brien M. Posey, MCSE, has received Microsoft's Most Valuable Professional Award four times for his work with Windows Server, IIS and Exchange Server. He has served as CIO for a nationwide chain of hospitals and healthcare facilities, and was once a network administrator for Fort Knox. You can visit his personal Web site at www.brienposey.com.|