AlphaSure Ltd. 41 Walpole Road London E18 2LN United Kingdom

 

Running the DOS AT Command (AT.exe)

 

This command runs a batch file (click here) at a specific time of day, or on set days (similar to Cron or Crontab on Linux)

 

If you open a DOS Window and type "AT" you will get "there are no entries in the list" response from the computer. (NT,W2K, XP and Server 2003.         Windows 98, ME etc will say "bad command or filename").

 

If you have a batch file from the example labelled copyret.bat, and you instead type

 

at 23:00 /every:M,T,W,Th,F "c:\copyret.bat"

 

the computer will say "Added a new job with id = 1"

 

If you now type "AT", you will get the following, showing that there is one job set to run on every Monday, Tuesday, Wednesday, Thursday and   Friday at 23.00hrs, and that job is in the batch file copyret.bat. Note that under the column "Status ID" this job is set to 1. This is how you refer to it when deleting or manipulating it:

 

To delete this job, you type "at 01 /delete" as per the above example, so the next at command shows that it has been deleted..

 

The overviewof how the command should be constructed is as follows:

 

      Create an AT job:

      AT [\\computername] hh:mm [/INTERACTIVE] [ /EVERY:day(s) | /NEXT:day(s) ] "command"

 

      Delete an AT job:

      AT [\\computername] [ [id] [/DELETE] | /DELETE [/YES]]

 

The syntax for different days are as follows:

Monday = m

Tuesday = t

Wednesday = w

Thursday = th

Friday = f

Saturday = s

Sunday = su

 

 

The brief explanations of the commands are as follows:

 

\\computername : Execute the AT command on a remote computer.

 

   id              : An id number AT assigns to each scheduled job.

 

   /delete         : Cancel a scheduled job. If id is omitted, all jobs are deleted.

 

   /yes            : Use with /delete to supress the confirmation message.

 

    hh:mm           : The time to run the command.

 

   /interactive    : Allow the job to interact with the desktop of

                    the current user when the job runs.

 

   /every:day(s)   : Run the command every day(s) of the week or month.

                    (default: dd=today)

 

   /next:day(s)    : Run the command on the next occurrence of the day.

                    (default: dd=today)

 

   "command"       : The batch program or command to run. If the path

                    to this includes spaces, put double quotation marks  

                    around the path. "C:\Program Files\My Batch.cmd"

 

Note that you should be an Administrator to get the AT command to work.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Hit Counter
DialUp Internet Providers