At command, as the name indicates, can be used to schedule applications at specified time and date. This is a built-in command in Windows OS and does not require any separate software to be installed on the computer.
First thing you need to know is that At command requires Task Scheduler service to be running on the system. Otherwise you would get an error like below.
C:\>at The service has not been started.
Let’s see few examples on how to use At command.
Schedule a task at a particular time
To schedule a task we just need to specify the time and the command for the task we need to run. For example, if you want to shutdown your computer at 11PM today then you can do this by running the below command.
At 11:00:00PM shutdown -r
Schedule a Recurrent Task
We can schedule tasks that run recurrently once in a week or once in a month. We can use /every switch for this purpose. Let’s say you want to automatically run defragmentation on one of the drives once in every week. This can be done by running the below command
At 10:00:00AM /every:Monday defrag c:
After running this command system will initiate defragmentation on C: drive at 10 AM on every Monday.
See the tasks scheduled
We can see the list of scheduled tasks just by running At command without any parameters.
Status ID Day Time Command Line
1 Each M 10:00 AM defrag c:
Schedule a task on some other day
We can use /next switch to schedule tasks for a different day. For example to run defragmentation on C: drive on next Thursday you can run the below command.
At 11:00:00AM /next:Thursday defrag c:
Schedule tasks to run every day
Using /every switch we can schedule a task to be run every day. For example to shutdown your computer automatically every day at 11PM you can create a task using the below command.
At 10:00:00AM /every:M,T,W,TH,F,SA,SU shutdown -r
Delete Scheduled Tasks
We can delete scheduled tasks from the database by using /delete switch. We need to pass the id of the task we need to delete. We can see the id for each task by running At command without any parameters. For example to delete the task with the id 1 we need to run the below command.
At 1 /delete