To force a shutdown of your Windows 11 PC after a specified period of inactivity, you can use the Task Scheduler to create a task that triggers a shutdown command after 30 minutes of idle time. However, if your PC is frequently busy (as indicated by SSD activity), the idle timer may reset, preventing the shutdown from occurring. Here’s how to set it up:
- Open Task Scheduler: Press
Windows + R, typetaskschd.msc, and hit Enter. - Create a New Task: In the right pane, click on
Create Task. - General Tab: Name your task (e.g., "Force Shutdown After Idle") and select "Run whether user is logged on or not".
- Triggers Tab: Click
New, set the trigger to "On idle", and specify the duration (30 minutes). - Actions Tab: Click
New, set the action to "Start a program", and in the Program/script box, typeshutdown. In the "Add arguments" box, enter/s /t 0to force shutdown immediately. - Conditions Tab: Ensure that "Start the task only if the computer is idle for" is checked and set to 30 minutes. You may also want to uncheck "Wake the computer to run this task" to prevent the task from running if the computer is busy.
- Settings Tab: Check "If the task fails, restart every" and set a reasonable interval to ensure it attempts to run again if it doesn't execute the first time.
- Save the Task: Click OK and enter your password if prompted.
This setup should help you achieve the desired shutdown behavior after 30 minutes of inactivity, but keep in mind that if the system is busy, it may still affect the idle detection.
References: