Scheduling Jobs
In order to schedule jobs to run at specific dates and times you must first ensure that the schedule service is running. The schedule service runs automatically with the default Windows NT configuration so unless you (or someone else) has previously disabled this service it should already be running on your system. If it isn't already running then you can start it for this session only by typing net start schedule at a command prompt while logged on with administrator access.
To change the configuration to ensure that the schedule service runs automatically every session, log on with administrator access and click start, settings, Control Panel, and services then find Task Scheduler in the list of services and check that the status and startup options read "started" and "automatic" respectively. Use the startup to change the startup option to "automatic" and the start button to start the service for the current session.
The Schedule service is initially configured to run in the system account on the local computer. When the service runs using this account, there are no restrictions on the jobs that can be executed by the service. These jobs will however have limited network access, because the system account on a local computer is not recognized by other computers. To overcome network access limitations, you can configure the service to run in a user's account. Jobs executed by the service will then be governed by network access of the user's account. To configure the service to run in a user's account log on with administrator access and click start, programs, Administrative Tools (common), and User Manager then give this user's account the "Log on as a service" right on the local computer then log on as the specified user and configure the schedule service to start under this user's account.
To schedule the specific commands and programs to be run on the computer at specified times and dates, you then use the at command. The format of the at command is as follows:
at [\\computername] [[id] [/delete [/yes]] or
at [\\computername] time [/interactive] [/every:date[,...] | /next:date[,...]] "command"
- Used without parameters, this command lists all scheduled commands.
- \\computername specifies a remote computer. If this parameter is omitted, the commands are scheduled on the local computer.
- id is an identification number assigned to a scheduled command.
- /delete cancels a scheduled command. If id is omitted, all the scheduled commands on the computer are cancelled.
- /yes forces a yes answer to all queries from the system when deleting scheduled events.
- time specifies the time when command is to run. Time is expressed as hours:minutes in 24-hour notation (00:00 [midnight] through 23:59).
- /interactive allows the job to interact with the desktop of the user who is logged on at the time the job runs.
- /every:date[,...] runs the command on every specified day(s) of the week or month (for example, every Tuesday, or the fifth day of every month). Specify date as one or more days of the week (M,T,W,Th,F,S,Su) or one or more days of the month (using numbers 1 through 31). Separate multiple date entries with commas. If date is omitted, the current day of the month is assumed.
- /next:date[,...] runs the specified command on the next occurrence of the day (for example, next Friday). Specify date as one or more days of the week (M,T,W,Th,F,S,Su) or one or more days of the month (using numbers 1 through 31). Separate multiple date entries with commas. If date is omitted, the current day of the month is assumed.
- "command" is the Windows NT command, program (.EXE or .COM file) or batch program (.BAT or .CMD file) to be run. When the command requires a path as an argument, use the absolute path, that is, the entire pathname beginning with the drive letter. If command is on a remote computer, specify the server and sharename, rather than a remote drive letter. You may use quotation marks around the command, whether you are using at the command line or in a batch file. If the command includes switches that are used by both the command and at, you must enclose command in quotation marks. The at command does not automatically load cmd, the command interpreter, before running commands. Unless you are running an executable (.EXE) file, you must explicitly load CMD.EXE at the beginning of the command by adding cmd to the front of the command
Note: If you change the system time at a computer after scheduling a command to run with at, synchronize the at scheduler with the revised time by typing at without options. Scheduled commands are stored in the registry, so scheduled tasks are not lost if you have to restart the Schedule service. The at command requires you be a member of the local Administrator group.


