Scheduled Tasks

Microsoft Windows has a built in Task Scheduler.

With Scheduled Tasks, you can schedule any script, program, or document to run at a time that is most convenient for you.

Scheduled Tasks starts every time that you start Windows XP and runs in the background, and it starts each task that you schedule at the time that you specify when you create the task.

Batch files can also be scheduled.

Main purpose of Scheduled Tasks

Running database utilities to check data integrity on a large database can be time consuming. However this must be done on a regular basis.

The task scheduler running a batch file to check data integrity during off peak hours makes this convenient.

Database utilities creates a log file that can be checked the following morning for results.

See Database Utilities for more.

Sample Scheduled Task

A batch file consisting of a single text line as shown below can perform two checks on the acme.nv2 database

c:\nv\nv2.exe -script system/database_utilities.qw_script ^
     .command "check_block_readability check_index_record_integrity" ^
     .file c:/nv/acme.nv2
        

Since the command line is quite long we broke it from one physical line into several by using the batch file line continuation character, i.e. the "^" caret character.

See Batch Files for more.

How to Schedule a Task

To open Scheduled Tasks, click Start, click All Programs, point to Accessories, point to System Tools, and then click "Scheduled Tasks".

To schedule a new task:

  1. Double-click Add Scheduled Task to start the Scheduled Task Wizard, and then click Next in the first dialog box.

  2. The next dialog box displays a list of programs that are installed on your computer, either as part of the Windows XP operating system, or as a result of software installation.

    If you want to run a program, script, or document that is not listed, click Browse, click the folder and the batch file that you want to schedule, and then click Open.

  3. Type a name for the task, and then choose one of the following options:
        * Daily
        * Weekly
        * Monthly

  4. Click Next, specify the information about the day and time to run the task, and then click Next.
    Note that the information about the day and time to run the task vary depending on the selection that you made in the previous wizard dialog box. For example, if you chose Weekly, you must indicate the day of the week, the time, and if the task should run every week, every 2 weeks, every 3 weeks, and so on.

  5. Type the name and password of the user who is associated with this task. Make sure that you choose a user with sufficient permissions to run the program. By default, the wizard selects the name of the user who is currently logged on.

  6. Click Next, and then click Finish after you verify the choices that you have made.


Copyright (c) 2003-2022 Q.W.Page Associates Inc., All Rights Reserved.