cmd: The "at" command
Windows, like Unix, has an "at" command. It's basically a command-line interface for Task Scheduler. I use it rather often but haven't memorized the syntax so I've decided to put it here in my blog.
Note: The
atcommand has been deprecated. For modern systems, it is recommended to useschtasks.exeor the PowerShell*-ScheduledTaskcmdlets. This post is preserved for historical context.
Here is example syntax for running a VBS script:
1at 12:00 /every:m,t,w,th,f,s,su %SystemDirectory%\cscript.exe C:\scripts\fileFetch.vbs
Here are a few notes to remember about the at service:
- The script will run with the permissions of the user that is used to start the "Task Scheduler" or "at" service. Make sure the user has adequate permissions to Objects you are creating and the directory where you will save your file.
- Make sure the account that is used to start the
atservice has "log on as a service" enabled. - To delete a schedule task, run the
atcommand and look for its id. Next, runat id /delete. For example:at 1 /delete.