Task Scheduler

Execute Task on Shut Down

  1. Open Task Scheduler:
    • Press the Windows Key, type Task Scheduler, and press Enter.
  2. Create a New Task:
    • In the right-hand panel, click Create Task… (avoid Create Basic Task).
  3. General Tab:
    • Give your task a Name.
    • Select Run whether user is logged on or not.
    • Check Run with highest privileges.
  4. Triggers Tab:
    • Click New…
    • Set Begin the task to On an event.
    • Set Log to System.
    • Set Source to User32.
    • Set Event ID to 1074 (this code logs when a user or application initiates a shutdown or restart).Click OK.
  5. Actions Tab:
    • Click New…
    • Leave Action as Start a program.
    • Click Browse to select your program, script, or batch file, or type the path directly in Program/script.
    • Click OK.
  6. Conditions and Settings Tabs:
    • Uncheck Start the task only if the computer is on AC power under Conditions.
  7. Save the Task:
    • Click OK and enter your Windows administrator credentials if prompted.