Chapter 13. Scheduling One-time and Recurring Tasks

One of the most powerful aspects of Windows scripting is the ability to schedule scripts to run automatically. You can schedule scripts to run one time only at 5 p.m. on Wednesday, every day at 11 p.m., every other Monday at 2 a.m., and at other times that are convenient. Just as important, you can schedule scripts to run on any network computer and you can manage those scripts through an easy-to-use graphical interface or an equally powerful command-line utility.

Scheduling Local and Remote Jobs

Windows Scripts that run automatically on a periodic or one-time basis are referred to as scheduled jobs or scheduled tasks. While these scheduled jobs can perform any regular scripting duty, there are some important differences in how scheduled jobs are used. So before we dive into job scheduling, let's look at these differences.

Note

Only authorized users can manage services and network time. You may need administrative privileges to perform the tasks in this section.

Scheduling basics

Scheduled jobs are started by a Windows service called Task Scheduler. This service must be running on the local or remote system in order for task scheduling to operate. You can check the status of the Task Scheduler in the Services node of the Computer Management console or through the Services console itself.

Figure 13-1 shows the ...

Get Microsoft® PowerShell, VBScript and JScript® Bible now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.