Windows hard-freezing with no BSOD? This post walks you through an open-source, reversible PowerShell script that fixes common “mystery hangs” by turning off USB Selective Suspend, setting PCIe ASPM to Off, and disabling Hibernation/Fast Startup — with a single command and an easy -Undo
.
What this script does
- USB Selective Suspend → Disabled (prevents flaky hubs/peripherals from sleeping badly)
- PCIe ASPM → Off (avoids link state transitions that can hang GPUs/NVMe/capture cards)
- Hibernation/Fast Startup → Off (removes resume edge cases; frees
hiberfil.sys
) - Optional: cleans leftover Intel XTU service + driver packages
- Saves a JSON backup so you can undo anytime
View source / download on GitHub →
Why these changes help
- USB selective suspend can park ports; some hubs, DACs, keyboards, VR sensors don’t wake cleanly → input/video “dead”.
- PCIe ASPM can push links into low-power states; some GPUs/NVMe/controllers choke on rapid transitions.
- Fast Startup/Hibernation mixes hibernate/resume paths; marginal drivers can hang on resume.
How to run it (Admin PowerShell)
One-liner (downloads and runs directly from GitHub):
irm https://raw.githubusercontent.com/wbaconsulting/windows-freeze-tune/main/scripts/WindowsFreezeTune.ps1 | iex
Run locally (after cloning/downloading the repo):
powershell -NoProfile -ExecutionPolicy Bypass -File .\scripts\WindowsFreezeTune.ps1
Undo later:
powershell -NoProfile -ExecutionPolicy Bypass -File .\scripts\WindowsFreezeTune.ps1 -Undo
Logs: %Public%\WindowsFreezeTune-Logs\
Backup: %ProgramData%\WindowsFreezeTune\backup.json
Baseline → Change → Measure (simple test plan)
We’re aiming for stability, not FPS numbers. Establish a baseline, apply changes, then measure after 7–14 days.
- Before running
- Count Kernel-Power 41 events (last 14 days):
Get-WinEvent -FilterHashtable @{LogName='System'; Id=41; StartTime=(Get-Date).AddDays(-14)} | Measure-Object
- Export devices with Status ≠ OK:
Get-PnpDevice | Where-Object Status -ne 'OK' |
Select-Object Class, FriendlyName, Status |
Export-Csv "$env:PUBLIC\Before-Devices-Not-OK.csv" -NoTypeInformation
- Note your last boot (for uptime comparisons):
(Get-CimInstance Win32_OperatingSystem).LastBootUpTime
- Run WindowsFreezeTune, then reboot once.
- After 7–14 days, re-run the same commands and compare “Before” vs “After”. Optionally keep a brief “freeze diary”.
Success heuristic: fewer/no hard resets, fewer USB driver restarts, longer average uptime.
Parameters
Param | Type | Default | Description |
---|---|---|---|
-Undo | switch | false | Restores your prior power settings & hibernation from the JSON backup |
FAQ
Does this reduce gaming performance?
No — turning ASPM Off typically stabilizes PCIe devices and doesn’t cap clocks. Disabling hibernation has no FPS impact.
Is this a “debloat” script?
No. It targets power-state issues behind hard freezes. No privacy/services bloatware changes.
Is it reversible?
Yes. Use -Undo
to restore your exact prior values.
What if freezes persist?
Next suspects: RAM/XMP instability, CPU/GPU overclocks, storage/PSU issues, or buggy third-party drivers. The script’s logs help you narrow it down.
License & Contact
MIT License.
© Watertown Business Advisory, LLC — wbaconsulting.org
Source: github.com/wbaconsulting/windows-freeze-tune
Leave a Reply