Windows 7 / Getting Started

Automating Diagnostic Tasks with Task Scheduler

Task Scheduler provides a means for running jobs automatically on the server. You use Task Scheduler to specify a particular time or event that tells Windows to begin doing work. For example, you can tell Task Scheduler to automatically defragment your hard drive. You open Task Scheduler by choosing Start → Programs → Accessories → System Tools → Task Scheduler. You see the Task Scheduler display.

Discovering the task status

The Task Status pane tells you how many tasks are running. You can go into the individual folders to determine the task status. The default setting shows you the last 24 hours of activity. You can change this default to anything from 30 days to 1 hour. When you change the status window, you see more or fewer tasks in the window.

Below the Task Status pane is the Active Tasks pane. This pane shows which tasks Task Scheduler has scheduled to run, including those that are currently running.

Using preconfigured tasks

Task Scheduler comes with a number of preconfigured tasks. You find them in the Task Scheduler Library. If you want to use one of these tasks, highlight its folder. For example, you can defragment a drive manually or defragment it on a schedule, so Task Scheduler provides two templates you can use for the task.

To modify one of these templates, highlight its entry and choose Properties in the Actions pane. You see the task Properties dialog box. This Properties dialog box tells you everything about the task. For example, you can see the application name, how the task is run, and the security options for the task. These templates can tell you a lot about how to run your own tasks because you know that they're already debugged and ready to use.

The Triggers tab is the one to use for starting the task. A trigger is an event that starts the task. You may think that the only trigger available is a scheduled time. However, you can also create triggers for various events, such as

  • Logon for a particular user
  • System startup
  • Idle time
  • When an event occurs the event gets logged into the event log
  • Task creation or modification
  • Connection to a user session
  • Disconnection from a user session
  • Workstation docking
  • Workstation undocking

No matter how you approach the problem, you still need a trigger to start the task, which means modifying something on the Triggers tab. You can use a number of approaches when working with this tab. First, you can simply enable the default trigger that Microsoft provides. Highlight the trigger entry, click Edit, check Enabled in the Edit Trigger dialog box, and click OK. You're ready to go at this point. Second, you can create a new trigger. Simply click New and you see the New Trigger dialog box, where you can configure the trigger to meet your needs.

Creating your own tasks

In some cases, you need to create your own tasks for an application that isn't part of Windows. You have two options for creating a new task. The first option is to create a basic task. You can also create a task by using the Create Task dialog box. To use this option, click Create Task. You see a dialog box. The only difference is that you need to supply the entries for it. The templates show you how to create a task by using this approach.

[Previous] [Contents] [Next]