Thursday, July 3, 2008

AT - Schedule tasks to be performed at a specified time and date

AT

Enables users to schedule tasks to be performed at a specified time and date.


C:Documents and Settings>at /?

The AT command schedules commands and programs to run on a computer at
a specified time and date. The Schedule service must be running to use
the AT command. ( Note : Use "net start" to verifty the service is running)

AT [\computername] [ [id] [/DELETE] | /DELETE [/YES]]
AT [\computername] time [/INTERACTIVE]
[ /EVERY:date[,...] | /NEXT:date[,...]] "command"

\computername Specifies a remote computer. Commands are scheduled on the
local computer if this parameter is omitted.
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 canceled.
/yes Used with cancel all jobs command when no further
confirmation is desired.
time Specifies the time when command is to run.
/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 each specified day(s) of the week or
month. 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 Thursday). If date is omitted, the
current day of the month is assumed.
"command" Is the Windows NT command, or batch program to be run.


Examples

At 22:00 every night run a batch script called rman_backup.bat

C:Documents and SettingsAdministrator>AT 22:00 /every:M,T,W,Th,F,S,Su cmd /c "L:Backuprman_backup.bat"

Added a new job with job ID = 1

Running at on its own gives a detailed list of all jobs available


C:Documents and SettingsAdministrator>AT
Status ID Day Time Command Line
-------------------------------------------------------------------------------
1 Each M T W Th F S Su 16:55 PM cmd /c "C:Documents and SettingsAdministratorhello.BAT"

To delete a scheduled job

C:Documents and SettingsAdministrator>AT 1 /DELETE


To check the status of a job

C:Documents and SettingsAdministrator>AT 1

Task ID: 1
Status: OK
Schedule: Today
Time of day: 16:55 PM
Interactive: No
Command: C:Documents and SettingsAdministratorhello.BAT

No comments: