How to create scheduled tasks with Command Prompt on Windows 10
You can create, edit, and delete scheduled tasks using Command Prompt without the need of ever opening Task Scheduler, and in this guide we'll show you how to do it.
Windows 10 ships with Task Scheduler, which is an advanced tool that allows you to create and run routines automatically. Using this tool, you can automate tasks to perform all sorts of things, including launching an app, running a specific command, or executing a script at a specified day and time, or when a particular condition is met using triggers.
Although there's a graphical experience to use Task Scheduler, you can also use Command Prompt to create, edit, and delete tasks, which can come in handy in many situations. For instance, when you need to speed up the process to create the same task on multiple computers, and when building an application or script that needs to connect with the tool — just to name a few.
In this Windows 10 guide, we'll walk you through the steps to get started managing scheduled tasks using the schtasks.exe tool on Command Prompt.
- How to create a scheduled task using Command Prompt
- How to change a scheduled task using Command Prompt
- How to delete a scheduled task using Command Prompt
How to create a scheduled task using Command Prompt
To create a scheduled task with Command Prompt on Windows 10, use these steps:
- Open Start.
- Search for Command Prompt, right-click the top result, and select the Run as administrator option.
- Type the following command to create a daily task to run an app at 11:00am and press Enter:Syntax
SCHTASKS /CREATE /SC DAILY /TN "FOLDERPATH\TASKNAME" /TR "C:\SOURCE\FOLDER\APP-OR-SCRIPT" /ST HH:MM
ExampleSCHTASKS /CREATE /SC DAILY /TN "MyTasks\Notepad task" /TR "C:\Windows\System32\notepad.exe" /ST 11:00
Quick tip: The folder path before the task name, under the /TN option, is not a requirement, but it'll help you to keep your tasks separate. If you don't specify a path, the task will be created inside the Task Scheduler Library folder.
- Type the following command to create a weekly task to run an app at 11:00am and press Enter:Syntax
SCHTASKS /CREATE /SC WEEKLY /D SUN /TN "FOLDERPATH\TASKNAME" /TR "C:\SOURCE\FOLDER\APP-OR-SCRIPT" /ST HH:MM
ExampleSCHTASKS /CREATE /SC WEEKLY /D SUN /TN "MyTasks\Notepad task" /TR "C:\Windows\System32\notepad.exe" /ST 11:00
- Type the following command to create a monthly task to run an app at 11:00am and press Enter:Syntax
SCHTASKS /CREATE /SC MONTHLY /D 15 /TN "FOLDERPATH\TASKNAME" /TR "C:\SOURCE\FOLDER\APP-OR-SCRIPT" /ST HH:MM
ExampleSCHTASKS /CREATE /SC MONTHLY /D 15 /TN "MyTasks\Notepad task" /TR "C:\Windows\System32\notepad.exe" /ST 11:00
- Type the following command to create a scheduled task that runs daily as a specific user and press Enter:Syntax
SCHTASKS /CREATE /SC DAILY /TN "FOLDERPATH\TASKNAME" /TR "C:\SOURCE\FOLDER\APP-OR-SCRIPT" /ST HH:MM /RU USER-ACCOUNT
ExampleSCHTASKS /CREATE /SC DAILY /TN "MyTasks\Notepad task" /TR "C:\Windows\System32\notepad.exe" /ST 11:00 /RU admin
Once you complete the steps, the task will run during the intervals you specified.
Task Scheduler create options
The command line version of Task Scheduler ships with many options allowing to customize many aspects of a task, and in this guide, we are using the following options to change a scheduled task:
- /CREATE — specifies that you want to create a new an automated routine.
- /SC — defines the schedule for the task. Options available, include MINUTE, HOURLY, DAILY, WEEKLY, MONTHLY, ONCE, ONSTART, ONLOGON, ONIDLE, and ONEVENT.
- /D — specifies the day of the week to execute the task. Options available, include MON, TUE, WED, THU, FRI, SAT, and SUN. If you're using the MONTHLY option, then you can use 1 - 31 for the days of the month. Also, there's the wildcard "*" that specifies all days.
- /TN — specifies the task name and location. The "MyTasks\Notepad task" uses the "Notepad task" as the name and stores the task in the "MyTasks" folder. If the folder isn't available, it'll be created automatically.
- /TR — specifies the location and the name of the task that you want to run. You can select an app or custom script.
- /ST — defines the time to run the task (in 24 hours format).
- /QUERY — displays all the system tasks.
- /RU — specifies the task to run under a specific user account.
These are just some of the available options. You can learn more about the options to create a scheduled task running the
Get the Windows Central Newsletter
All the latest news, reviews, and guides for Windows and Xbox diehards.
SCHTASKS /CREATE /?
command.
How to change a scheduled task using Command Prompt
To modify a scheduled task on Windows 10 with Command Prompt, use these steps:
- Open Start.
- Search for Command Prompt, right-click the top result, and select the Run as administrator option.
- Type the following command to change the time to run the task 9:00am and press Enter:Syntax
SCHTASKS /CHANGE /TN "FOLDERPATH\TASKNAME" /ST HH:MM
ExampleSCHTASKS /CHANGE /TN "MyTasks\Notepad task" /ST 09:00
- Type the following command to change the task user information and press Enter:Syntax
SCHTASKS /CHANGE /TN "FOLDERPATH\TASKNAME" /RU NEW-USERNAME
ExampleSCHTASKS /CHANGE /TN "MyTasks\Notepad task" /RU admin2
- Type the following command to disable a scheduled task and press Enter:Syntax
SCHTASKS /CHANGE /TN "FOLDERPATH\TASKNAME" /DISABLE
ExampleSCHTASKS /CHANGE /TN "MyTasks\Notepad task" /DISABLE
Quick tip: If you want to re-enable the task, you can use the same command, but make sure to use the/ENABLE
option instead.
After completing the steps, the task will be modified with the information that you've specified.
Task Scheduler change options
In this guide, we are using the following options to create a scheduled task:
- /CHANGE — specifies that you want to edit an existing task.
- /TN — specifies the name and location of the task that you want to modify.
- /ST — defines the new time to run the automated routine.
- /DISABLE — disables the task.
These are just some of the available options. You can learn more about the options to change a scheduled task running the
SCHTASKS /CHANGE /?
command.
How to delete a scheduled task using Command Prompt
If you no longer need a particular task, you can delete it using these steps:
- Open Start.
- Search for Command Prompt, right-click the top result, and select the Run as administrator option.
- Type the following command to delete a scheduled task and press Enter:Syntax
SchTask /DELETE /TX "FOLDERPATH\TASKNAME"
ExampleSCHTASKS /DELETE /TN "MyTasks\Notepad task"
- Press the Y key to confirm.
Once you complete the steps, the task will be removed, and it'll no longer be available on your device.
Task Scheduler delete options
In this guide, we are using the following options to delete a scheduled task:
- /DELETE — specifies that you want to delete an existing task.
- /TN — specifies the name and location of the task that you want to delete.
We're focusing this guide on Windows 10, but the ability to use Task Scheduler with Command Prompt has been around for a long time, which means that you can also use these steps on Windows 8.1 and Windows 7.
Mauro Huculak has been a Windows How-To Expert contributor for WindowsCentral.com for nearly a decade and has over 15 years of experience writing comprehensive guides. He also has an IT background and has achieved different professional certifications from Microsoft, Cisco, VMware, and CompTIA. He has been recognized as a Microsoft MVP for many years.