Schtasks is a Windows command line prompt that is used to manage tasks and processes. It is a powerful tool that can be used to automate tasks, schedule tasks, and even create tasks. With Schtasks, users can create, delete, modify, and list tasks, as well as query the status of tasks. Schtasks can also be used to run tasks on remote computers. In this article, we will discuss the syntax, options, and user examples for Schtasks.

Syntax

The syntax for Schtasks is as follows:

  • Schtasks /Create [/S system [/U username [/P [password]]]]
  • Schtasks /Delete [/S system [/U username [/P [password]]]]
  • Schtasks /End [/S system [/U username [/P [password]]]]
  • Schtasks /Query [/S system [/U username [/P [password]]]]
  • Schtasks /Run [/S system [/U username [/P [password]]]]
  • Schtasks /Show [/S system [/U username [/P [password]]]]
  • Schtasks /Change [/S system [/U username [/P [password]]]]

The /S system parameter is used to specify the name of the remote computer on which the task will be run. The /U username parameter is used to specify the user name for the remote computer. The /P [password] parameter is used to specify the password for the remote computer.

Options

Schtasks has several options that can be used to customize the tasks that are created. These options include:

  • /TN taskname – This option is used to specify the name of the task.
  • /TR taskrun – This option is used to specify the program that will be run when the task is triggered.
  • /ST starttime – This option is used to specify the start time for the task.
  • /RI interval – This option is used to specify the interval at which the task will be triggered.
  • /DU duration – This option is used to specify the duration of the task.
  • /ET endtime – This option is used to specify the end time for the task.
  • /SD startdate – This option is used to specify the start date for the task.
  • /ED enddate – This option is used to specify the end date for the task.
  • /IT – This option is used to specify that the task should run interactively.
  • /RU username – This option is used to specify the user name that will be used to run the task.
  • /RP password – This option is used to specify the password that will be used to run the task.
  • /RL level – This option is used to specify the security level for the task.
  • /RP password – This option is used to specify the password that will be used to run the task.
  • /MO modifier – This option is used to specify the task modifier.
  • /TN taskname – This option is used to specify the name of the task.

User Examples

The following are some examples of how Schtasks can be used to manage tasks and processes:

  • Creating a Task – To create a task, use the following command:
    Schtasks /Create /TN “MyTask” /TR “C:\MyProgram.exe” /ST 12:00 /RI 5 /DU 24:00 /ET 18:00 /SD 01/01/2020 /ED 12/31/2020 /IT /RU “MyUser” /RP “MyPassword” /RL HIGHEST
  • Deleting a Task – To delete a task, use the following command:
    Schtasks /Delete /TN “MyTask” /S “MyComputer” /U “MyUser” /P “MyPassword”
  • Modifying a Task – To modify a task, use the following command:
    Schtasks /Change /TN “MyTask” /TR “C:\MyProgram2.exe” /ST 14:00 /RI 10 /DU 48:00 /ET 20:00 /SD 01/02/2020 /ED 12/31/2020 /IT /RU “MyUser” /RP “MyPassword” /RL HIGHEST
  • Querying a Task – To query a task, use the following command:
    Schtasks /Query /TN “MyTask” /S “MyComputer” /U “MyUser” /P “MyPassword”
  • Running a Task – To run a task, use the following command:
    Schtasks /Run /TN “MyTask” /S “MyComputer” /U “MyUser” /P “MyPassword”
  • Showing a Task – To show a task, use the following command:
    Schtasks /Show /TN “MyTask” /S “MyComputer” /U “MyUser” /P “MyPassword”

Conclusion

Schtasks is a powerful command line prompt that can be used to manage tasks and processes. It can be used to create, delete, modify, and list tasks, as well as query the status of tasks. It can also be used to run tasks on remote computers. Schtasks has several options that can be used to customize the tasks that are created. With Schtasks, users can automate tasks, schedule tasks, and even create tasks.

Leave a Reply