Using Task Scheduler

It's true that you could—and still can—schedule tasks using the AT command, as described later in this chapter, but Task Scheduler provides a graphical interface and is much easier to use. Tasks can be scheduled during off-hours and to run repeatedly. The Task Scheduler service is started at bootup and runs in the background. To use Task Scheduler, open Control Panel, double-click the Scheduled Tasks folder, and then follow these steps:

  1. In the Scheduled Tasks window, double-click the Add Scheduled Task entry. This starts the Scheduled Task Wizard. Click Next.
  2. Select a program from the screen (Figure 10-15), or click Browse to locate another program. Click Next.
  3. Supply a name for the task, and then indicate how often you want it performed. Click Next.

    Figure 10-15. Selecting the program to be scheduled.

  4. Select the time of day you want the task performed. Depending on the timing you've selected, you'll also need to specify one of the following:
    • Daily Task Every day, every n days, or weekdays only.
    • Weekly Task Every n weeks; supply the day of the week.
    • Monthly Task Select the day of the month, and select which months.
  5. Supply the user name and password for the user who will be scheduling tasks. Click Next. Note that the account you specify must have the privileges necessary to run the task. For example, if you're scheduling a backup program, the user must have backup rights.
  6. If you need to specify parameters for the task being scheduled, select the check box next to Open Advanced Properties and then click Next.
  7. Make the necessary changes and click OK.

    For tasks to run as expected, it's important that the computer's date and time be set correctly.

Many programs will start to run in Task Scheduler and then pause, waiting for input that never comes—or that comes much later, when someone looks at the machine to see what's going on. To make sure you have all of the parameters for a task to be able to run successfully, open a command prompt and type program_name /?. Then right-click the task in the Scheduled Tasks window and choose Properties from the shortcut menu. Enter the necessary parameters in the Run text box and click OK.

You might want to schedule a task to run right away so you can test its performance. If a task is scheduled by a user and that user isn't logged on at the scheduled time, the task still runs but is in the background and not visible.

Unfortunately the Windows 2000 disk defragmenter utility doesn't support scheduled operation (unlike the defrag program in Microsoft Windows XP and the Microsoft Windows .NET Server family). To schedule a defrag operation, you can either purchase a commercial defrag program that supports scheduling, such as Executive Software's Diskeeper, or you can write or download a script that enables the Windows disk defragmenter to be scheduled. (To find such a script, perform a Web search on "Windows 2000 disk defragmenter".)

Changing a Schedule

Even the best schedule can run up against reality now and again, so you need to be able to adjust your planned events.

  • To run a task immediately, right-click the task's icon in the Scheduled Tasks window and choose Run from the shortcut menu.
  • To stop a task that's running, right-click the task's icon in the Scheduled Tasks window and choose End Task. If the scheduled task has been set up to start another task, the End Task command halts only the original scheduled task.
  • To temporarily halt all Task Scheduler actions, open the Advanced menu in the Scheduled Tasks window and choose Pause Task Scheduler. Any tasks that do not start because Task Scheduler is paused will run again only at their next scheduled time. To start Task Scheduler up again, click the same menu and choose Continue Task Scheduler.
  • To stop using Task Scheduler, open the Advanced menu in the Scheduled Tasks window and choose Stop Using Task Scheduler. No scheduled tasks will run, and the Task Scheduler service will no longer start automatically when the system is rebooted.

Tracking Task Scheduler

The system maintains a detailed log of Task Scheduler's activities. To view the log, double-click Scheduled Tasks in Control Panel. From the Advanced menu, choose View Log. This opens a log like the one shown in Figure 10-16, with the most recent entry at the bottom of the window. The Details view in the Scheduled Tasks window displays information about each task (Figure 10-17).

Figure 10-16. The Task Scheduler log.

Figure 10-17. The Details view for scheduled tasks.

If a scheduled task doesn't execute as expected, right-click the task in the Task Scheduler window and choose Properties from the shortcut menu. Verify that the task is in fact enabled. (The Enabled check box in the Task Properties window should be selected.)

Viewing Tasks on a Remote Computer

If you are an administrator of a remote computer running Windows NT or Windows 2000, you can view and edit the Task Scheduler settings on that computer. Find the computer in the My Network Places window (in Windows 2000) or in the Network Neighborhood window (in Windows NT), and then double-click the Scheduled Tasks folder.

To view and edit scheduled tasks on computers running Windows 95 or later, the remote computer must

  • Have remote administration enabled
  • Specify your user account as having remote administrative access
  • Share the hard disk on which the Scheduled Tasks folder resides


Microsoft Windows 2000 Server Administrator's Companion
Microsoft Windows 2000 Server Administrators Companion
ISBN: 0735617856
EAN: 2147483647
Year: 2003
Pages: 320

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net