Pcornel
Windows · Task Scheduler

Actions

Cheat sheet · https://pcornel.dk/topic.php?topic=3024

Back to the Topic

Answer

Task actions define what a scheduled task does, usually start a program with arguments and a working directory, such as powershell.exe -File script.ps1. A task can run several actions in order.

Remember

  • Use full paths for programs and scripts.
  • Arguments go in their own field.
  • Set the working directory ('Start in').

First 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)

Verify in this order

action starts program with arguments in the start-in folder → exits with a code

Where it usually breaks

First mismatch in definition/configuration → security context → service/task/process creation → runtime state → output/side effect → event/performance evidence; preserve identity/native error/pre-state before mutation.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=3024

Confirmation

Confirm action

Continue?