Subscribe to Windows IT Pro
December 20, 2000 12:00 AM

Win2K Task Scheduler

Windows IT Pro
InstantDoc ID #16220
Rating: (0)
A new graphical way to schedule tasks

Windows 2000 includes Task Scheduler, a new graphical tool that you can use to run scripts or programs according to a schedule. The tool helps you create and customize scheduled tasks, then saves the tasks as .job files, which reside in \%systemroot%. You can schedule tasks to run locally, or you can email or copy .job files to remote computers to run scheduled tasks on those computers. Although Task Scheduler doesn't completely replace the At command, which you might be familiar with from Windows NT, Task Scheduler does offer a simpler, more efficient way to schedule tasks. Task Scheduler's advantages over the At command include easier administration, more configuration options (e.g., options to schedule tasks during logon, system startup, or idle time), and the ability to run tasks in different security contexts. (For information about the interaction of Task Scheduler and the At command, see the sidebar "What About the At Command?")

Launching Task Scheduler
Before you run Task Scheduler, be sure the computer's date and time settings are correct. To launch the utility, use the Control Panel Scheduled Tasks applet, or click Start, Programs, Accessories, System Tools, Scheduled Tasks, then double-click the Scheduled Tasks icon. The Scheduled Tasks window opens to display an Add Scheduled Task icon, as well as icons for any existing tasks. You can choose among three methods for creating a new task: Use the Scheduled Task Wizard; manually configure the task; or drag a program, script, or document into the Scheduled Tasks window.

Using the Scheduled Task Wizard
To launch the Scheduled Task Wizard, double-click the Add Scheduled Task icon. Click Next to move past the opening screen. The wizard presents a list of the application files on your computer; this list includes applications that you installed with the OS as well as any third-party software that appears in the Control Panel Add/Remove Programs applet. If the application you want to schedule isn't on the list, click Browse to open the Select Program to Schedule window. You can then select a local application or script, or you can browse through the network to select an object on a remote computer. After you select an object, click Next.

The next screen, which Figure 1 shows, prompts you to name the task and specify when you want it to run. The subsequent screen prompts you to enter a start time and other options specific to the task's frequency. (If you selected the When I log on or When my computer starts option, the wizard skips this screen.)

The next screen prompts you to enter a username and password; the task will run as if started by that user. The final screen offers the usual Finish button but also includes an option to automatically open the created task's Properties dialog box when you click Finish.

Manually Creating a Scheduled Task
After you're familiar with Task Scheduler, manually creating a task is often faster than using the wizard. The manual process also lets you move among settings to fine-tune the task. Instead of stepping through the wizard, you can manually create a task, then leap directly to the task's Properties dialog box to configure the task. This manual procedure also applies to dragging an application or script into the Scheduled Tasks window; the only difference is that dragging the application or script into the window creates the new scheduled task.

To create a task, open the Scheduled Tasks window, then click File, New, Scheduled Task. (You can also right-click a blank spot in the Scheduled Tasks window and choose New, Scheduled Task.) A New Task icon appears. The title is in Edit mode so that you can immediately enter a name for the new task. Right-click the task icon, and click Properties to open the task's Properties dialog box. The Properties dialog box contains four tabs, which offer several options for manually configuring the task.

The Task tab. On the Task tab, which Figure 2 shows, enter the name and path of the application you want to run. If any part of the path contains spaces, enclose the entire path in quotation marks. If the scheduled task is an executable file, you can add parameters you want to run with the program. Next, enter the user under which the task will run. You can also disable the task from this tab; to do so, clear the Enabled (scheduled task runs at specified time) check box.

The Schedule tab. On the Schedule tab, specify the task's frequency. Note that a difference exists between the options on this tab and those in the wizard. When you choose to run a task Daily, the wizard offers a Weekdays option; the Properties dialog box doesn't. If you want to run a manually configured task only on weekdays, you must select Weekly on the Schedule tab, then select individual days. To fine-tune the schedule, click Advanced; the advanced options differ depending on the schedule frequency (e.g., Daily, Weekly) that you choose.

The Settings tab. The Settings tab, which Figure 3 shows, offers options to control task operation under certain system conditions. Under Scheduled Task Completed, you can select the Delete the task if it is not scheduled to run again check box for tasks that have an end date or that run only once. When you select this option, Task Scheduler removes the job after the last automatic occurrence. Don't select this option if you might reincarnate the task. The Stop the task if it runs for option lets you end the task after a specified time (the default is 72 hours). This option is useful for time-consuming middle-of-the-night operations that must finish before the business day begins. Because the default allowance is overly generous for most tasks, you should configure the time to suit the operation's needs rather than accept the default.

Under Idle Time, you can specify options for a task that you configured to execute during idle time (i.e., time during which no mouse or keyboard activity occurs on the target system). Of course, no mouse or keyboard activity doesn't mean a computer is idle; all sorts of activities could be happening, including downloads, database searches, or other automated tasks. Keep this caveat in mind when you schedule tasks: You probably don't want several I/O- or processor-intensive tasks running at the same time unless you're prepared to let them run longer than they typically would individually. The Idle Time options don't necessarily make scheduled tasks run more efficiently.

Under Power Management, you can specify a task's behavior if battery-power problems arise when the task is scheduled to run or is already running. This option applies to laptops rather than computers that switch over to a UPS during electrical power loss. (UPS software such as American Power Conversion's—APC's—PowerChute usually configures all programs, including automated tasks, for shutdown in such an event.) An option to Wake the computer to run this task appears for computers that support that feature.

The Security tab. On the Security tab, which Figure 4 shows, you can specify the users who can view, delete, modify, or use a task. (Table 1, page 102, describes the available permission levels.) Task Scheduler bases task security on standard Win2K security permissions. Remember that the program, script, or document that the task runs might also have security restrictions if the target computer runs NTFS. Be careful not to create a conflict between these security levels.

To configure advanced security options for the task, click Advanced. The Access Control Settings dialog box, which Figure 5 shows, presents options for granular control over permissions, auditing, and ownership.

Working with Scheduled Tasks
After you create and configure a task, you might want to modify it or check its status. Task Scheduler offers several options for working with existing tasks.

Start and stop scheduled tasks. You can run any task at any time rather than wait for the next scheduled occurrence. To start a task, open the Scheduled Tasks window, select the task, and choose File, Run from the menu bar. (You can also right-click the task, then click Run.) To stop a running task, right-click the task, then click End Task. The message might take a moment to reach the task.

Related Content:

ARTICLE TOOLS

Comments
  • Count Ludwig
    11 years ago
    Apr 09, 2001

    This person did not do their homework.
    "Scheduled tasks" is buggy, unreliable and lost some of the
    functionality that was there with the old "at" scheduler in NT.
    For Example, you cannot control it from the command line and if you do any remote management as I'm sure most of us do, it is unusable. Next, if you open/review/modify an existing task, it looses the security context and you must re-enter the username/password, Lastly, Scheduled tasks randomly lose their username/password context information
    and simply stop running. This is a reported bug as listed on m$ website but you have to pay for a support call to get "the fix" Huh? How much did I pay for this software?!?
    Should I trust my data to this? ... I think not.

  • Paul Belli
    11 years ago
    Feb 07, 2001

    The article does not make it clear that it is impossible to schedule tasks on remote machines without quite some effort, unlike using the "at" command, which can under NT4.

    Sure you can copy .job files, but they lose their security information when they arrive at the remot machine (though I do see why this should be). This means you must use the GUI tool to set a username and password for the remote job to run.

    As someone who has been used to being able to schedule remote "at" jobs on hundreds of machines, this is less than useful.

    An equivalent command line tool to "at" to do remote job submission in Windows 2000 would have been a good idea.

You must log on before posting a comment.

Are you a new visitor? Register Here

advertisement

advertisement

Windows is a trademark of the Microsoft group of companies. Windows IT Pro is used by Penton Media Inc. under license from owner.