Schedule Tasks with Command Prompt

There’re so many available ways to create schedule tasks in Windows XP. From command line until GUI tools, you can choose one from them. And then I curious to try the command line schedule tasks tools which have bundled by Windows XP. The tools are at command and schtasks command.

The at command is an old command that avaiable since Windows 2000 (correct me if I wrong), you can create remote tasks with this command. And best part from at command is it has simple parameters. Just put some parameters with it and then a task will created. On other side with schtasks command you can create complex tasks but maybe you can confused with its parameters that so complicated.
OK, first we will learn about at command.

  1. To use at command, open your command console first via Start -> Run menu and then type cmd in textbox or via Start -> All Programs -> Accessories -> Command Prompt.
  2. At prompt type at /? if you want get some help from at command.
  3. To create a remote task, just type at \\server 6pm /every:sunday "winword.exe", we can learn from that command parameters, \\server is your remote computer, 6pm is the time that the task will ran, /every:sunday is day parameter and last “winword” is task will ran.
    AT Command
  4. If you want display all running tasks just type at on prompt.
    AT Command
  5. To delete a task, type at 2 /delete, number 2 is id task you can look it with typing at at your prompt (point 2), /delete is parameter to delete a task. To delete entire tasks, type at /delete.
    AT Command to delete task
  6. Almost forgeted, if you want create a local task, just type at 6pm /every:sunday "test.bat", you can look the explaining in point 3.
    AT Command to create task on local computer

Now, I want discuss about schtasks command.

  1. To create a task with schktaks command, type schtasks /create /ru system /sc weekly /d fri /tn "Remain me to make report" /tr "excel.exe" /st 19:00:00. And this is the explanation from that command; /create is parameter to create task, /ru is parameter to set user that run this task, /sc is paremeter to defines frequency the task will ran you can choose MINUTE, HOURLY, DAILY, WEEKLY, MONTHLY, ONCE, ONSTART, ONLOGON, ONIDLE for parameter value, /d is day to run, /tn is parameter to task name, /tr is parameter to set task to run, /st is parameter to start to run.
    Schtaks command
  2. To display all run tasks type schtasks at prompt.
    Schtaks command to view entire task
  3. To display all tasks that have been created with at command or schtasks command you can display it with Scheduled Tasks software that run in GUI mode. To open it click StartAll ProgramsAccessoriesSystem Tool - ,
    GUI mode to view entire task
    and look what happend with your all tasks in there.
    GUI mode to view entire task
  4. And to delete task with schtasks command, type schtasks /delete /tn "Remain me to make report" /F, /tn fill with your task name, /f parameter is parameter to forces the utility to delete the task and suppress any warnings when the task is currently running.
    Command to delete a task
  5. To display all schtasks parameter type schtasks /? or if you want detail about /delete parameter or else, type schtasks /delete /? at your prompt.

I hope your job to scheduling your task will be more easier.

note:
Whaever the method you take to create scheduled tasks don’t forget to activate Task Scheduler Service (by default, Windows XP always activate it), to learn more about Activate Windows Service, look here.
Task Service

Leave a Comment