Scheduled Tasks That Survive a Windows Reboot

TL;DR / Summary: A scheduled task on a Windows VPS must survive reboots, missed runs, and a session that nobody is logged into. Configure it to run whether the user is logged in or not, and test after a real restart rather than a sign-out.

The three settings that decide everything

Task Scheduler offers many options, and three of them determine whether a task runs reliably on a remote server.

The first is the user context: the account the task runs as must have the rights the task needs. The second is the “run whether user is logged on or not” option. The third is “run with highest privileges” for tasks that require elevation.

A task that runs only when the user is logged in will fail silently on a server, because nobody is logged in most of the time.

  • Run whether user is logged on or not — required on a server
  • Run with highest privileges — required for admin operations
  • Do not store password — affects whether the task can access network resources
  • Start in — the working directory; omitting it breaks relative paths

Why the working directory matters

A scheduled task starts in the system directory by default, not in the script’s folder. A script that references a relative path will fail, and the error will look like a missing file rather than a path problem.

Set the “Start in” field to the script’s directory. This single setting prevents a large share of scheduled-task failures.

Better still, use absolute paths inside the script. Belt and braces is appropriate here, because the failure is silent.

Interactive versus non-interactive tasks

Some tools require an interactive desktop session—older automation software, certain GUI applications, and anything that expects a visible window.

Run those with a dedicated service account and consider whether the tool supports headless operation. Forcing an interactive task onto a server is a fragile arrangement that breaks on reboot.

Testing after a genuine restart

Signing out is not the same as rebooting. Many tasks appear to work after a sign-out and fail after a restart because the task’s dependency is not available at boot.

Perform an actual restart and then check the task history. The history shows the last run result, including error codes that the UI does not explain.

Test with the task set to run a few minutes after boot, and confirm the result. A task scheduled for 2 a.m. is hard to test immediately, so temporarily change the trigger.

A scheduled task that has never been tested after a reboot is an assumption, not automation.

Missed runs and catch-up

Servers go down for maintenance. A task scheduled to run at a specific time will simply not run if the server is off, unless you enable the catch-up option.

“Run task as soon as possible after a scheduled start is missed” is the setting that matters. Enable it for jobs that must not be skipped, and leave it off for jobs where a late run would be harmful.

A backup job should catch up. A job that sends a daily email should probably catch up too. A job that resets a counter at midnight should not run late in the afternoon.

Credentials and stored passwords

Storing a password in a task is convenient and creates a maintenance burden: when the password changes, the task stops working, usually without a clear error.

Use a service account with a password that does not expire, or better, a group managed service account where the domain supports it.

If a task must access network shares, storing the password is often unavoidable. Document which account each task uses, so a password rotation does not silently break automation.

Logging and diagnosis

Windows Task Scheduler keeps a history, but it is verbose and often disabled by default. Enable task history and check it as the first diagnostic step.

Have the task itself log to a file as well. Application-level logs are more useful than scheduler logs for understanding what the script did rather than whether it started.

Log a start line, an end line, and an exit code. Three lines per run and a diagnostic problem becomes a five-minute investigation instead of an hour.

Monitoring the schedule

A task that stops running is invisible unless you are watching. Add an external check that expects a heartbeat—a file written, a row inserted, an email sent.

Alert on absence rather than on presence. The absence of a heartbeat is the only signal that matters, and it is the one that internal logging cannot report.

Review the task list quarterly. Old tasks accumulate, and a disabled task someone forgot about is a future mystery.

A reliable starting configuration

Run as a service account, with “run whether the user is logged on or not” enabled, a “Start in” directory set, catch-up enabled, and logging inside the script.

For remote administration, Windows VPS environments behave like any other Windows server here, and the same testing discipline applies.

Scheduled tasks are one of the most reliable parts of Windows once configured correctly. The work is in the configuration and in the one restart test that most people skip.

Task dependencies and start order

A task that depends on a service must wait for that service to start. On a reboot, services start in an undefined order, and a task that fires early fails.

Add a delay or an explicit dependency on the service rather than relying on timing. Explicit dependencies survive configuration changes that timing does not.

Check the task history after a reboot for the first week. The failures are usually intermittent, and intermittent failures in automation are the ones nobody notices until they matter.