Magic command for advanced users

Jan 2, 2007 15:18 GMT  ·  By

For those of you who are melancholic about the old times when MS-DOS ruled our computers and we needed to use commands whenever we wanted to do a job, here is an unknown (for many of you) Windows command that enables you to schedule tasks: the "at" command.

I know Windows offers a Scheduled tasks application under System Tools but using this command can be instructive and useful in situations when there is no access to Scheduled tasks' application or any other similar program. Learning commands increases your computer knowledge, letting you do unbelievable things just from the command prompt console.

The purpose of this command is to schedule scripts, launch programs or any other computer action at a specified time and date. The "at" command offers the possibility to create schedule tasks, view already created tasks or delete obsolete ones.

There are two conditions that must be fulfilled in order to be able to use this command:

1. First of all, you need to be logged as administrator or your user account to be part of the administrators group.

2. Make sure that task scheduler service is running. To see this, go to command prompt and type net start. All running services will be shown. If task scheduler is not listed, just type: net start "task scheduler."

Note: In case "task scheduler" service is disabled (not just stopped) you must go to Start-> Run and type services.msc. Look for this service, enable it and then start it.

Review image
Review image
Review image
Review image
Creating a scheduled task using the "magical" command

To work, you need to add parameters to the command in accordance with your needs. Here is the list with these parameters:

■ computername: In case you want to use a remote computer. If this parameter is missing from the syntax, the task will be programmed for the local computer. ■ time: It specifies the time! Hours and minutes must be entered according to the pattern: 00:00. ■ /interactive: It allows the task to interact with the desktop of the user who is logged on at the time the task runs. ■ /every:date,...: It permits scheduling for every mentioned day of the week separated by commas and using the following abbreviations: M,T,W,Th,F,S,Su or one or more days of the month. ■ /next:date,...: Same with the parameter above but it instructs the task to run the next occurrence of the day. ■ command: This parameter is used to specify a Windows command, program or batch program that is to be run. ■ id: Every created task has its own ID. ■ /delete: Use it to delete scheduled tasks. ■ /yes: This parameter forces the confirmation when needed.

Example of a task created with the "at" command:

Open the command prompt (Start->Run->cmd) and type:

at 19:30 /every:M,T,W,Th,F copy C:Softpedia TEST*.* C:Command TEST

Translation: During the working week, at 19:30 sharp all the documents inside the "Softpedia TEST" folder will be copied to "Command TEST" folder.

There are no limits. You just need imagination and the need to schedule a task.

Review image
Review image
Delete scheduled tasks

Once you do not need a task anymore, you can easily delete it using /delete command. After you have created a task, an ID number is provided starting with number 1 and going up. So, when you want to delete a task, just type: at id /delete. In case you do not specify the ID number, all the tasks from the local computer will be deleted.