Using the AT Command

[Previous] [Next]

You can also use the AT command to schedule tasks. By default, the AT command is run using the LocalSystem account, which requires administrative privileges. To specify another account as the user of the AT command, follow these steps:

  1. Open Control Panel and double-click Scheduled Tasks.
  2. In the Scheduled Tasks window, open the Advanced menu and then choose AT Service Account.
  3. Click This Account and specify a particular user and password. Click OK.

AT Command Syntax

The command structure for the AT command is as follows:

 AT [\\computername] [id] [[/delete]|/delete [/yes]] AT [\\computername] time [/interactive] [/every:date[,…] | /next:date[,…]] command 

The following parameters can be used with the AT command. Used without parameters, the AT command returns a list of scheduled commands.

  • \\computername Specifies a remote computer. Without this parameter, the local computer is assumed.
  • id Indicates the identification number, if one is assigned.
  • /delete Cancels a scheduled command. If no identification number is specified, all scheduled commands on the computer will be canceled.
  • /yes Forces a yes answer to all system queries when canceling all commands.
  • time Specifies when the command is to run, expressed as hours:minutes in 24-hour notation.
  • /interactive Allows the task to interact with the desktop of the user logged on at the time the job is run.
  • /every:date[,...] Runs the command on the date specified. The date can be specified as one or more days of the week (M, T, W, Th, F, S, Su) or as one or more days of the month (numbers 1 through 31). Separate multiple dates with commas. If this parameter is omitted, the current day of the month is assumed.
  • /next:date[,...] Runs the command on the next occurrence of the specified day. If this parameter is omitted, the current day of the month is assumed.
  • command Indicates the program, batch file, or command to be run. If a path is required, use the Uniform Naming Convention (UNC) path.

Here are some important facts to keep in mind about the AT command:

  • The AT command doesn't automatically load Cmd, the command interpreter, so if the command parameter doesn't point to an executable file, you must explicitly specify Cmd, followed by the /c switch, at the beginning of the command.
  • Commands scheduled using AT run as background processes, so there is no displayed output. To redirect output to a file, use the redirection symbol (>). The redirection symbol must be preceded by the escape symbol (^), so a sample command would be at retrieve.bat ^>c:\daylog.txt.
  • If you have to use a drive letter to connect to a shared directory, include an AT command to disconnect the drive when the task is completed. Otherwise, the assigned drive letter will be neither available nor seen at the command prompt.

NOTE
You can switch back and forth between the AT command and Task Scheduler, although there are some limitations. For example, if you schedule a task using AT and later modify that same task using Task Scheduler, the task is then "owned" by Task Scheduler and you can no longer access it using AT.



Microsoft Windows 2000 Server Administrator's Companion, Vol. 1
Microsoft Windows 2000 Server Administrators Companion (IT-Administrators Companion)
ISBN: 1572318198
EAN: 2147483647
Year: 2000
Pages: 366

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net