====== Task Scheduler ====== ===== Execute Task on Shut Down ===== - Open Task Scheduler: * Press the Windows Key, type //Task Scheduler//, and press Enter. - Create a New Task: * In the right-hand panel, click //Create Task...// (avoid Create Basic Task). - General Tab: * Give your task a **Name**. * Select **Run whether user is logged on or not**. * Check **Run with highest privileges**. - 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**. - 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**. - Conditions and Settings Tabs: * Uncheck **Start the task only if the computer is on AC power** under //Conditions//. - Save the Task: * Click **OK** and enter your Windows administrator credentials if prompted.