How To Use the Windows AT Command to Schedule Tasks
The AT Scheduler is a command line Scheduler.
This means, all work is done at CMD interface. To start working with the AT Scheduler, go to a CMD prompt. To do this, follow these steps.
Click on “Start” and select “Run”
Type in “CMD” (without the quotes) and click “OK”.
You will be at a command line interface.
Note The AT Scheduler does not care about your current directory location. For the sake of clarity, we are using the root of the C: drive in this troubleshooter.
C:>\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.
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.
IMPORTANT: Tasks that Administrators want to run in the System Context must be setup using the AT command at a command line.
If any aspect of the task is modified (except changing the Task Name in the Task Scheduler User Interface) through the UI, the Set Account Information dialog will appear requesting that you enter a password once you hit Ok or Apply. The Domain and User Name of the user who is modifying the task is already entered as the user who’s context the task will run under in the Run As section. At this point the task will never run in the System Context again. This is because you’ve already hit Ok or Apply and erased the System Account information from within the task. Even canceling out of the Set Account Information will not restore the System Account as the Context to run the task in. If the credentials are changed and no password has been entered the task will fail with the following error:
“At<number>.job” (<executable>) <date/time> ** ERROR **
The attempt to log on to the account associated with the task failed, therefore, the task did not run.
The specific error is:
0×8007052e: Logon failure: unknown user name or bad password.
Verify that the task’s Run-as name and password are valid and try again.
.
Command line examples
Some basic examples of AT command lines:
The following command line schedules a task that runs notepad interactively the next time 12:00pm occurs.
C:\>at 12:00pm /interactive notepad.exe
The following command line schedules a task that runs notepad interactively on the server named TEST the next time 12:00pm occurs.
C:\>at \\TEST 12:00pm /interactive notepad.exe
The following command line displays the currently scheduled jobs on the server named TEST. Sample output is shown as well. (Note that each scheduled task is given an ID).
C:\>at \\TEST
Status ID Day Time Command Line
———————————————————–
1 Tomorrow 1:59 AM map.exe
2 Tomorrow 3:00 AM notepad.exe
The following command deletes the AT scheduled job with an ID of 1 from the Task Scheduler on the server named TEST.
C:\>at \\TEST 1 /delete
The following command schedules a task that runs notepad interactively every week on Thursday.
C:\>at 7:03pm /interactive /every:thursday notepad.exe
The following command schedules a task that runs notepad interactively every month on the 20th day.
C:\>at 7:03pm /interactive /every:20 notepad.exe
AT Command Task SchedulerAT Command Task Scheduler
No Comments »
Filed under: Task Scheduler

