CronCanary DocsPricingOpen app
← Integration guides

Monitor Windows Task Scheduler jobs

Task Scheduler shows a result code in its History tab, if you remembered to enable history — but nothing on a default Windows install emails, texts, or pages anyone when a scheduled task fails or a task is disabled.

Why Windows scheduled tasks fail silently

Task Scheduler ships with All Tasks History disabled by default — until someone right-clicks the root of the library and turns it on, even a task that fails every single run leaves no visible trail beyond a bare "Last Run Result" code most people never decode. Tasks are also routinely disabled without anyone noticing: a Group Policy refresh, a Windows feature update, or an admin troubleshooting something else can flip a task off, and it stays off silently forever. A task configured to run as a specific user account breaks the moment that account's password expires or is changed and never re-entered into the task's credentials — it then fails at launch with an authentication error buried in Event Viewer, not anywhere a person looks day-to-day. And because most scheduled scripts are simple .ps1 or .bat files with no error handling, an exception partway through often leaves the task showing "The operation completed successfully" (Task Scheduler only checks the process's exit code, and PowerShell exceptions don't automatically produce a non-zero exit code unless you handle them).

Wrap the script in PowerShell

Ping at the start, and use try/catch so a thrown exception is reported instead of silently exiting 0:

$url = "$URL" # e.g. https://croncanary-ping.sleeezydesigns.workers.dev/<your-uuid> try { Invoke-RestMethod -Uri "$url/start" -TimeoutSec 5 | Out-Null Backup-Database # your existing function/script Invoke-RestMethod -Uri $url -TimeoutSec 5 | Out-Null } catch { Invoke-RestMethod -Uri "$url/fail" -TimeoutSec 5 | Out-Null exit 1 # make sure Task Scheduler sees a real failure too }

Report the real exit code

For a plain .bat or a legacy tool with its own exit codes, report the code directly instead of a binary success/fail:

backup.exe set rc=%ERRORLEVEL% curl -fsS "%URL%/%rc%" exit /b %rc%

Register the task with schtasks

Create or update the task from a script so the wrapper above is what actually runs on schedule:

schtasks /Create /TN "Nightly Backup" /TR "powershell.exe -NoProfile -ExecutionPolicy Bypass -File C:\scripts\backup.ps1" /SC DAILY /ST 04:00 /RU SYSTEM /F

Running as the SYSTEM account (/RU SYSTEM) sidesteps the "task breaks when a user's password expires" failure mode entirely, since SYSTEM has no password to expire.

Match the schedule

Give the check a Cron expression matching /SC DAILY /ST 04:00 (0 4 * * *) in the server's local timezone, with a grace period covering normal runtime plus a few minutes — Task Scheduler can start a task a little late if the machine was asleep or under load at the trigger time.


Related guides


Add a live status badge to your README

Every check has a public SVG badge that shows its live status (updates within ~1 minute). Paste this into any README — it doubles as a heartbeat anyone on the team can see:

[![CronCanary](https://croncanary.fluxath.app/badge/<your-check-id>.svg)](https://croncanary.fluxath.app)

Copy the exact markdown from your check's detail page. Add ?label=your-text to customize the left label.


Ready to wire this up? Create a free check — 20 checks, all alert channels, no card.