Using Schtasks.exe to Manage Schedule Tasks in Windows

The Schtasks.exe utility is used to manage Windows Task Scheduler jobs from the command line. You can use Schtasks.exe to view, run, create, delete or stop the Windows schedule tasks on a local or remote computer. With Schtasks.exe, you can perform all the same actions with the tasks that are performed from the mmc graphical interface of the Task Scheduler console (taskschd.msc).

The Schtasks.exe command has a rather complicated and confusing syntax. To get acquainted with the command, open a command prompt as administrator and run the following command:

schtasks.exe /?

schtasks exe

As you can see, the utility contains a set of subcommands. Each subcommand has its own syntax.

  • Schtasks /Create — Create a new scheduled task;
  • Schtasks /Delete — Delete the scheduled task;
  • Schtasks /Query — Display scheduled tasks list.
  • Schtasks /Change — Changes the scheduled task settings.
  • Schtasks /Run — Run the specific task;
  • Schtasks /End — Stop the running task;
  • Schtasks /ShowSid — Show the task’s security identifier by its name.

For example, to display all available parameters to create a new scheduled task, run the command:

Schtasks /Create /?


If you run the Schtasks command without parameters, it will display all of the scheduler tasks on the local computer (the list contains FolderName, TaskName, Next Run Time and Status).

For example:

TaskName Next Run Time Status

======================================== ======================

automountvhdx N/A Ready

GoogleUpdateTaskMachineCore 4/20/2019 11:09:53 AM Running

GoogleUpdateTaskMachineUA 4/19/2019 2:09:53 PM Ready

schtasks command line

To create a new task named RunPing, which executes a certain command every hour, run the command:

SCHTASKS /Create /SC HOURLY /TN RunPing /TR “ping –n 50”

SUCCESS: The scheduled task “RunPing” has successfully been created.

Open the Task Scheduler (taskschd.msc) mmc GUI and verify that the new task appears in the Task Scheduler Library list.

windows schtasks

To start this task immediately, type the command:

SCHTASKS /Run /I /TN RunPing

SUCCESS: Attempted to run the scheduled task “RunPing”.

As you can see, the command that you specified in the /TR parameter of a new task was launched.

schtasks windows 10

Check the status of this task:

SCHTASKS /query /tn RunPing

As you can see, the task is running:


TaskName Next Run Time Status

======================================== ====================== ===============

RunPing 4/19/2019 3:19:00 PM Running

To force this task to stop, run:

SCHTASKS /end /TN RunPing

SUCCESS: The scheduled task “RunPing” has been terminated successfully.

You can change the scheduled task settings. For example, you want to change the command to the clean DNS cache command:

SCHTASKS /Change /TR “ipconfig /flushdns” /TN RunPing

SUCCESS: The parameters of scheduled task “RunPing” have been changed.

Similarly, you can prohibit the execution of a scheduled task on a configured schedule:


Or activate the task to run by schedule:


schtasks command

To get detailed information about a specific task, run the command:

schtasks /query /tn runping /v /fo list

schtasks create task



TaskName: runping

Next Run Time: 4/19/2019 3:19:00 PM

Status: Ready

Logon Mode: Interactive only

Last Run Time: 4/19/2019 2:20:14 PM

Last Result: 267014

Author: DESKTOP-JOPF9root

Task To Run: ipconfig /flushdns

Start In: N/A

Comment: N/A

Scheduled Task State: Enabled

Idle Time: Disabled

Power Management: Stop On Battery Mode, No Start On Batteries

Run As User: root

Delete Task If Not Rescheduled: Disabled

Stop Task If Runs X Hours and X Mins: 72:00:00

Schedule: Scheduling data is not available in this format.

Schedule Type: One Time Only, Hourly

Start Time: 2:19:00 PM

Start Date: 4/19/2019

End Date: N/A

Days: N/A

Months: N/A

Repeat: Every: 1 Hour(s), 0 Minute(s)

Repeat: Until: Time: None

Repeat: Until: Duration: Disabled

Repeat: Stop If Still Running: Disabled

To delete the scheduled task, run:

schtasks /delete /tn runping

schtasks delete

You can use schtasks to manage tasks on a remote computer, just enter the name of the remote computer using the /S parameter.

For example, delete the CheckService task on the remote computer ServerOH1:

schtasks /delete /TN "CheckService" /S ServerOH1
I enjoy technology and developing websites. Since 2012 I'm running a few of my own websites, and share useful content on gadgets, PC administration and website promotion.
Cyril Kardashevsky

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.