Find out what keeps waking your PC from sleep — via Microsoft Learn
If your PC wakes up at night, powercfg can tell you what woke it last, which timers are set to wake it, and which devices (mouse, network card) are allowed to — then switch off wake for a device.
Takes effect right away
Command
Run in an administrator Command Prompt / Terminal window.
powercfg /lastwake
powercfg /waketimers
powercfg /devicequery wake_armed
powercfg /devicedisablewake "HID-compliant mouse"Undo
powercfg /deviceenablewake "HID-compliant mouse"Replace "HID-compliant mouse" with an exact name from thewake_armedlist. You can also untick Allow this device to wake the computer on the device's Power Management tab in Device Manager.powercfg /alists which sleep states your hardware supports.
Sources
- Powercfg command-line options — by Microsoft Learn
- Source reviewed
- 2026-11-02
- Link checked
- 2026-11-02
- Tested hands-on
- Not by Oddbyte.Me
Oddbyte.Me hasn't tried this on every Windows build, so keep the undo handy.