Pcornel
Browse topics
Options
Recent
Favorites
Windows · Technical reference

Task Scheduler

Direct answer

Task Scheduler runs programs or scripts automatically on triggers such as a schedule, startup, logon or event, with conditions and settings controlling when and as which account they run.

When to use this

Use this when a Windows task should run automatically, or when a scheduled task doesn't run or fails.

First 30 seconds

1. Get-ScheduledTaskInfo <name> — LastRunTime, LastTaskResult (0 = success)?

2. Trigger correct and enabled?

3. Action: program path and arguments, start-in folder.

4. Run as: account, "Run whether user is logged on or not", highest privileges?

5. History in TaskScheduler/Operational.

Operational verification

trigger fires → conditions met → task starts under its account → action runs → result recorded

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
Windows execution, automation and observability
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformWindows execution, automation and observability · Windows / Windows Server / PowerShell
Key commandschtasks
Scope / prerequisiteUse this when a Windows task should run automatically, or when a scheduled task doesn't run or fails.
Reference · 1
What next?2 suggested next steps
Child topics (this level)6
Catalog command links1
Evidence0
On this pageJump to a specific section
Windows command reference

Primary Commands

Configuration and operational commands for this Topic.

Drill down

Subtopics

Go one level deeper into this subject.

Key points
  • Last Run Result code explains failures.
  • Account and 'run whether logged on' matter.
  • Conditions can silently skip runs.
Key checks
  • Get-ScheduledTask -TaskName <name> | fl * — task definition
  • Get-ScheduledTaskInfo -TaskName <name> — last run time and result
  • schtasks /query /tn <name> /v /fo list — details in CMD
  • Get-WinEvent -LogName Microsoft-Windows-TaskScheduler/Operational -MaxEvents 30 — task history (enable first)
ReferenceImportant terms & boundaries1 section · depth on demand

How it works

Task Scheduler (service Schedule) runs programs and scripts on triggers such as time, logon, startup or events, under a chosen account. Tasks are stored as XML under C:\Windows\System32\Tasks and logged in Microsoft-Windows-TaskScheduler/Operational when history is enabled.

ReferenceConfiguration & state1 section · depth on demand

Commands

Get-ScheduledTask | Where State -ne Disabled
Get-ScheduledTaskInfo -TaskName "Backup"          # last run time and result
schtasks /query /tn "Backup" /v /fo list
$a = New-ScheduledTaskAction -Execute "powershell.exe" -Argument "-File C:\scripts\job.ps1"
$t = New-ScheduledTaskTrigger -Daily -At 2am
Register-ScheduledTask -TaskName "Job" -Action $a -Trigger $t -User "SYSTEM"

Documented example, not captured output. History is in the Microsoft-Windows-TaskScheduler/Operational log (enable it first).

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docWindows execution, automation and observability current

Authoritative/upstream documentation reviewed for bounded claims in Task Scheduler. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://learn.microsoft.com/en-us/windows/win32/taskschd/task-scheduler-start-page · confidence 94%
Confirmation

Confirm action

Continue?