Skip to main content

How to create scheduled tasks with Command Prompt on Windows 10

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

To create a scheduled task with Command Prompt on Windows 10, use these steps:

  1. Open Start.
  2. Search for Command Prompt, right-click the top result, and select the Run as administrator option.
  3. Type the following command to create a daily task to run an app at 11:00am and press Enter:SyntaxSCHTASKS /CREATE /SC DAILY /TN "FOLDERPATH\TASKNAME" /TR "C:\SOURCE\FOLDER\APP-OR-SCRIPT" /ST HH:MMExampleSCHTASKS /CREATE /SC DAILY /TN "MyTasks\Notepad task" /TR "C:\Windows\System32\notepad.exe" /ST 11:00Quick 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.

  1. Type the following command to create a weekly task to run an app at 11:00am and press Enter:SyntaxSCHTASKS /CREATE /SC WEEKLY /D SUN /TN "FOLDERPATH\TASKNAME" /TR "C:\SOURCE\FOLDER\APP-OR-SCRIPT" /ST HH:MMExampleSCHTASKS /CREATE /SC WEEKLY /D SUN /TN "MyTasks\Notepad task" /TR "C:\Windows\System32\notepad.exe" /ST 11:00

  1. Type the following command to create a monthly task to run an app at 11:00am and press Enter:SyntaxSCHTASKS /CREATE /SC MONTHLY /D 15 /TN "FOLDERPATH\TASKNAME" /TR "C:\SOURCE\FOLDER\APP-OR-SCRIPT" /ST HH:MMExampleSCHTASKS /CREATE /SC MONTHLY /D 15 /TN "MyTasks\Notepad task" /TR "C:\Windows\System32\notepad.exe" /ST 11:00

  1. Type the following command to create a scheduled task that runs daily as a specific user and press Enter:SyntaxSCHTASKS /CREATE /SC DAILY /TN "FOLDERPATH\TASKNAME" /TR "C:\SOURCE\FOLDER\APP-OR-SCRIPT" /ST HH:MM /RU USER-ACCOUNTExampleSCHTASKS /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

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:

  1. Open Start.
  2. Search for Command Prompt, right-click the top result, and select the Run as administrator option.
  3. Type the following command to change the time to run the task 9:00am and press Enter:SyntaxSCHTASKS /CHANGE /TN "FOLDERPATH\TASKNAME" /ST HH:MMExampleSCHTASKS /CHANGE /TN "MyTasks\Notepad task" /ST 09:00

  1. Type the following command to change the task user information and press Enter:SyntaxSCHTASKS /CHANGE /TN "FOLDERPATH\TASKNAME" /RU NEW-USERNAMEExampleSCHTASKS /CHANGE /TN "MyTasks\Notepad task" /RU admin2

  1. Type the following command to disable a scheduled task and press Enter:SyntaxSCHTASKS /CHANGE /TN "FOLDERPATH\TASKNAME" /DISABLEExampleSCHTASKS /CHANGE /TN "MyTasks\Notepad task" /DISABLEQuick 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:

  1. Open Start.
  2. Search for Command Prompt, right-click the top result, and select the Run as administrator option.
  3. Type the following command to delete a scheduled task and press Enter:SyntaxSchTask /DELETE /TX "FOLDERPATH\TASKNAME"ExampleSCHTASKS /DELETE /TN "MyTasks\Notepad task"

  1. 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 is technical writer for WindowsCentral.com. His primary focus is to write comprehensive how-tos to help users get the most out of Windows 10 and its many related technologies. He has an IT background with professional certifications from Microsoft, Cisco, and CompTIA, and he's a recognized member of the Microsoft MVP community.

1 Comment
  • Is there a way to use this to keep Num Lock active at all times with Windows 10? Currently, it's active when Windows first starts, but I have my PC set to shut off the screen after a certain period of inactivity (45 minutes, I think) - not hibernate or go to sleep; just turn the screen off. After I sit down to use my laptop again, and move the mouse to make the screen come back on, I type in my password and start using my computer. But, it never fails that I go to use the number keypad to sign into a website or something, and Num Lock isn't active. That causes the cursor to jump to the beginning of whatever dialog box I'm typing in, or the page to jump too the bottom or something, and it's SO FREAKING ANNOYING! Everytime the screen shuts off and I have to re-sign into Windows, Num Lock is inactive, and I'd like a way to always keep it active. I can't believe Microsoft hasn't done something about this - I can't be the only one irritated AF over this!