To speed up your Windows 11 PC’s shutdown process using PowerShell, you can automate certain tweaks that would otherwise require manual intervention. These adjustments involve modifying system settings and registry values to reduce the time Windows waits for unresponsive applications or services during shutdown. Below is a detailed step-by-step guide on how to achieve this:
Step 1: Open PowerShell with Administrative Privileges
- Press
Windows + S
to open the search bar. - Type PowerShell in the search box.
- Right-click on Windows PowerShell and select Run as Administrator.
- Confirm any User Account Control (UAC) prompts.
Step 2: Adjust Wait Times for Services and Applications
The shutdown process in Windows involves waiting for services and applications to close properly. By reducing these wait times, you can speed up the shutdown process.
Modify WaitToKillServiceTimeout
This setting determines how long Windows waits for services to stop before forcing them to close.
- In the elevated PowerShell window, run the following command:
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control" -Name "WaitToKillServiceTimeout" -Value "2000"
- This reduces the wait time from the default value of 5000 milliseconds (5 seconds) to 2000 milliseconds (2 seconds).
Modify WaitToKillAppTimeout
and HungAppTimeout
These settings control how long Windows waits for applications to respond before forcing them to close.
- Run these commands in PowerShell:
New-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "WaitToKillAppTimeout" -PropertyType String -Value "2000" -Force New-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "HungAppTimeout" -PropertyType String -Value "2000" -Force
Enable Automatic Task Termination (AutoEndTasks
)
This setting forces Windows to automatically terminate unresponsive tasks during shutdown.
- Run this command:
New-ItemProperty -Path "HKCU:\Control Panel\Desktop" -Name "AutoEndTasks" -PropertyType String -Value "1" -Force
Step 3: Disable Page File Clearing at Shutdown
Clearing the page file at shutdown can significantly slow down the process, especially if you have a large page file size.
- To disable this feature, run:
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" -Name "ClearPageFileAtShutdown" -Value 0
Step 4: Save Changes and Restart
After making these changes, restart your computer for them to take effect. The next time you shut down your PC, it should complete much faster than before.
Important Notes
- Always back up your registry before making changes, as incorrect modifications can lead to system instability.
- If you encounter issues after applying these tweaks, you can revert them by restoring default values:
WaitToKillServiceTimeout
: Set back to5000
.WaitToKillAppTimeout
andHungAppTimeout
: Remove or set back to default values (usually not defined explicitly).AutoEndTasks
: Set back to0
.ClearPageFileAtShutdown
: Set back to1
if needed for security purposes.