|

How To Use The Schtasks Command In Windows (2026)

Schtasks is a built-in Windows command that creates, changes, runs, stops, lists and deletes scheduled tasks from Command Prompt.

It does the same job as the Task Scheduler app, but you can type it or put it in a script.

This guide covers each schtasks operation Microsoft documents.

Table of Contents

Schtasks quick answer

Open Command Prompt as an administrator and use one of the commands below.

GoalCommand
Create a daily task at 8 AMschtasks /create /tn MyApp /tr c:\apps\myapp.exe /sc daily /st 08:00
List all tasksschtasks /query
Run a task nowschtasks /run /tn "Security Script"
Stop a task’s programschtasks /end /tn "My Notepad"
Change the program a task runsschtasks /change /tn "Virus Check" /tr C:\VirusCheck2.exe
Delete a taskschtasks /delete /tn "Start Mail"

What the schtasks command does

The Microsoft Learn schtasks page says the tool performs the same operations as Scheduled Tasks in Control Panel, and you can use the two together and interchangeably.

It has six operations: /create, /change, /delete, /end, /query and /run.

Microsoft lists Windows 11 and Windows 10 among the systems it applies to.

Permissions you need

Microsoft says you must be a member of the Administrators group to schedule, view and change all tasks on the local computer.

Only Administrators can schedule tasks, whatever account the task runs as.

  1. Select Start and type Command Prompt.
  2. Right-click the result and select Run as administrator.
  3. Type your schtasks command and press Enter.

The six schtasks operations

OperationWhat it does
/createSchedules a new task
/changeChanges the program (/tr), the run-as account (/ru), its password (/rp) or adds /it
/deleteDeletes a scheduled task
/endStops a program that a task started
/queryDisplays the tasks scheduled on the computer
/runStarts a scheduled task immediately

Create a task with /create

The schtasks create page lists three required parts: a schedule type with /sc, a task name with /tn and the program to run with /tr.

schtasks /create /sc daily /tn MyApp /tr c:\apps\myapp.exe /st 08:00

Use quotation marks around a task name that contains spaces.

Use the full path in /tr, because without one schtasks looks in the System32 folder.

Schedule types for /sc

ValueWhen the task runs
MINUTEEvery set number of minutes
HOURLYEvery set number of hours
DAILYEvery set number of days
WEEKLYEvery set number of weeks, on chosen days
MONTHLYOn chosen days or months
ONCEOne time, which needs /st
ONSTARTEvery time the system starts
ONLOGONWhen any user signs in
ONIDLEAfter the system is idle for the minutes in /i
ONEVENTWhen a matching event log entry appears

The /mo modifier sets how often the task repeats within its type, for example every 20 minutes or every 2 weeks.

Microsoft’s create examples

CommandWhat it does
schtasks /create /sc minute /mo 20 /tn "Security Script" /tr \\central\data\scripts\sec.vbsRuns every 20 minutes
schtasks /create /tn MyApp /tr c:\apps\myapp.exe /sc daily /st 08:00 /ed 31/12/2021Runs daily at 8:00 until the end date
schtasks /create /tn MyApp /tr c:\apps\myapp.exe /sc weekly /mo 2 /d FRIRuns every other Friday
schtasks /create /tn MyApp /tr c:\apps\myapp.exe /sc monthly /mo SECOND /d SUNRuns on the second Sunday of every month
schtasks /create /tn MyApp /tr c:\apps\myapp.exe /sc monthly /mo lastday /m *Runs on the last day of every month
schtasks /create /tn MyApp /tr c:\apps\myapp.exe /sc onstartRuns at every system start
schtasks /create /tn MyApp /tr c:\apps\myapp.exe /sc onidle /i 10Runs after 10 idle minutes

Useful /create options

OptionWhat it does
/st HH:mmStart time in 24-hour format
/sd and /edStart and end dates, in the format of your local date setting
/ru systemRuns the task as the System account, which has no password
/rl HIGHESTRuns with elevated privileges; the default is LIMITED
/itRuns only when the run-as user is signed in
/npDoes not store a password, so the task uses local resources only
/zDeletes the task after its schedule completes
/fCreates the task and suppresses the warning if it already exists
/delay mmmm:ssWaits after the trigger, for ONSTART, ONLOGON and ONEVENT only

List tasks with /query

The schtasks query page says running it with no other parameters lists all tasks on the system.

schtasks /query

Add /fo LIST /v for detailed output, which Microsoft suggests for checking a task’s recurrence pattern.

schtasks /query /fo LIST /v

Use /tn to ask about one task by its path and name, and note that it does not accept wildcards.

schtasks /query /tn "\Microsoft\Office\Office Subscription Maintenance"

Run a task now with /run

The schtasks run page says /run starts a task immediately and ignores its schedule.

It does not change the schedule or the next scheduled run time.

schtasks /run /tn "Security Script"

Microsoft recommends this for testing a task, and says to check SchedLgU.txt in the Windows folder if a task does not run.

Change a task with /change

The schtasks change page says you can change the program, the run-as account, the password and some schedule values, but you cannot rename a task.

schtasks /change /tn "Virus Check" /tr C:\VirusCheck2.exe

Add /ENABLE or /DISABLE to turn a task on or off without deleting it.

The /it property can be added but not removed with /change.

Stop a task with /end

Per the schtasks end page, /end stops only the instances of a program that a scheduled task started.

schtasks /end /tn "My Notepad"

To stop any other process, Microsoft points to the taskkill command.

Delete a task with /delete

Microsoft’s schtasks delete page says deleting a task removes only its schedule, so the program stays on disk and a running program is not interrupted.

schtasks /delete /tn "Start Mail"

Add /f to skip the confirmation prompt.

Be careful with /tn *, because it deletes every task on the computer, including tasks other users scheduled.

Mistakes to avoid

MistakeWhat Microsoft says
Assuming a wrong path or password will be caughtschtasks does not check them, so the task is created but will not run
Putting several programs in one taskEach task runs one program, so use a batch file
Expecting a run-now option in /createThere is none; use /run or a ONCE task a few minutes ahead
Scheduling a ONCE task in the pastIt cannot be scheduled in the past on the local computer
Using /rp with /ru System/rp is invalid there, because System has no password

Prefer the Task Scheduler app?

The command and the app edit the same tasks, so you can mix them.

Our guide to creating a scheduled task in Windows 11 covers the point-and-click version.

For another command-line tool in the same series, see the gpupdate command guide.

Sources

All syntax, parameters, examples and notes come from Microsoft Learn: schtasks, create, query, run, change, end and delete.

Leave a Reply

Your email address will not be published. Required fields are marked *