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. Here is example syntax for running a VBS script:

at 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

a. 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.
b. Make sure the account that is used to start the at service has “log on as a service” enabled.
c. To delete a schedule task, run the at command and look for its id. Next, run at id /delete. For example: at 1 /delete

Chrissy is a Cloud and Datacenter Management & Data Platform MVP who has worked in IT for over 20 years. She is the creator of the popular SQL PowerShell module dbatools, holds a master's degree in Systems Engineering and is coauthor of Learn dbatools in a Month of Lunches. Chrissy is certified in SQL Server, Linux, SharePoint and network security. You can follow her on Twitter at @cl.

Posted in Windows