WINDOWS TASK BUILDER

Windows Task Builder

Fill in the blanks and get a complete schtasks /create command — schedule dropdowns, correct quoting, and a copy button. Plus a searchable Last Run Result code reference for tasks that fail.

Fill in the blanks — the schtasks /create command assembles live below. The form adapts to the schedule type you pick.

examples
schtasks

The /sd and /ed date format follows the machine's regional settings (MM/DD/YYYY on US-locale systems). Creating tasks that run as SYSTEM or with highest privileges requires an elevated prompt. A custom account will be prompted for its password when the command runs.

Last Run Result codes

When a scheduled task fails silently, Task Scheduler records a hex Last Run Result — the column in taskschd.msc, or the Last Result line from schtasks /query /tn "Name" /v /fo LIST. Search a code or keyword to see what it means and how to fix it. 0x0 is success; anything else is either the program's own exit code or a Task Scheduler SCHED_* constant.

code constant meaning severity
task scheduler 101

Task Scheduler and schtasks

Windows Task Scheduler is the service behind every scheduled job on Windows — what cron is to Unix. schtasks.exe is its command-line face; the GUI (taskschd.msc) and PowerShell's Register-ScheduledTask manage the same task store. Tasks live in a folder tree — name a task \MyFolder\MyTask to keep things organized.

The verbs

commandwhat it does
schtasks /create …create a task (what this tool builds)
schtasks /query /tn "Name" /v /fo LISTinspect a task — status, last/next run, last result
schtasks /run /tn "Name"run it right now (great for testing)
schtasks /end /tn "Name"stop a running instance
schtasks /change /tn "Name" …modify an existing task
schtasks /delete /tn "Name" /fremove it

The flags this tool generates

flagmeaning
/tntask name (quote it if it has spaces)
/trthe program to run, with its arguments
/scschedule type: MINUTE, HOURLY, DAILY, WEEKLY, MONTHLY, ONCE, ONSTART, ONLOGON, ONIDLE
/momodifier — "every N" for time schedules, or FIRST/SECOND/THIRD/FOURTH/LAST/LASTDAY for monthly patterns
/d / /mdays (MON-SUN or 1-31) and months (JAN-DEC)
/st / /sd / /edstart time (24h HH:MM), start date, end date
/ru / /rpthe account the task runs as, and its password (SYSTEM needs none)
/rl HIGHESTrun elevated ("highest privileges" — the checkbox in the GUI)
/foverwrite an existing task with the same name
/iidle minutes to wait (ONIDLE only)

Quoting — the part everyone gets wrong

The whole /tr value needs outer double quotes, and if the program path itself contains spaces it needs its own escaped quotes inside:

/tr "\"C:\Program Files\App\run.exe\" --flag value"

Get this wrong and Windows tries to run C:\Program with Files\App\run.exe as an argument. Two reliable escapes: the nested-quote form above (this tool generates it for you), or dodge the problem entirely with an 8.3 short name like C:\PROGRA~1\App\run.exe — spaceless, so no inner quotes needed. Short names are assigned by the filesystem, so confirm the real one with for %I in ("C:\path with spaces\x.exe") do @echo %~sI (they can also be disabled system-wide).

Gotchas worth knowing

  • Elevation — creating tasks that run as SYSTEM, as another user, or with /rl HIGHEST requires an elevated (Administrator) prompt.
  • Date format/sd and /ed follow the machine's regional settings: MM/DD/YYYY on US systems, DD/MM/YYYY elsewhere. A "working" command can break on a differently-configured server.
  • Last Run Result0x0 means success; 0x1 usually means the program wasn't found or returned 1 (often a quoting problem); 0x41303 means "has not yet run". The searchable Last Run Result codes table below the builder decodes these and the rest, with a fix for each.
  • Password changes — a task registered with /ru user stores credentials; when that password changes, the task quietly stops running until it's re-registered.
  • Working directory — schtasks gives you no flag for it; tasks start in System32. Use absolute paths inside your scripts, or cd /d first in a wrapper .cmd.