Power & sleep · Windows 11
Fix a PC that wakes itself from sleep in the middle of the night
A PC that wakes itself at night is almost always obeying an instruction: a wake timer, a scheduled task, or a device allowed to wake it. Ask Windows what woke it last, then switch off that one permission instead of disabling sleep altogether.
What you need
- One night where it actually woke. The wake history only names the most recent wake, so run the first check in the morning after a wake, before you sleep the PC again.
- A terminal window. The built-in powercfg tool reports the last wake source and lists every device allowed to wake the PC.
- Administrator rights for the device changes. Reading the wake history needs no special rights; changing a device's wake permission can.
Read the problem before you touch it
- Ask Windows what woke it. Open Windows Terminal and run
powercfg /lastwake. The output names the wake source: a device such as the network adapter or a mouse, a wake timer, or the power button. That one answer decides the whole rest of the fix. - Notice the pattern in the time. Wakes at the same time every night point at a scheduled task or maintenance window. Random wakes point at a device — a sensitive mouse, a network adapter seeing traffic, or a Bluetooth device reconnecting.
- Do not disable sleep itself. Sleep is working; something is waking the PC from it. Microsoft's overview of the sleep states is in Shut down, sleep, or hibernate your PC. The fix is removing the wake permission, not the sleep.
The simple fixes, in order
- Turn off wake timers. Open Control Panel > Power Options, choose Change plan settings for your plan, then Change advanced power settings. Under Sleep > Allow wake timers, set it to Disable. This stops scheduled tasks from waking the PC while leaving your own key press working.
- Stop the mouse waking the PC. In Device Manager, open your mouse under Mice and other pointing devices, go to the Power Management tab, and clear Allow this device to wake the computer. A mouse on a desk that gets bumped, or a wireless mouse reconnecting, is the most common random-wake cause.
- Stop the network adapter waking the PC. In Device Manager, open the network adapter, and on its Power Management tab clear Allow this device to wake the computer. If you use Wake on LAN deliberately, instead tick Only allow a magic packet to wake the computer so ordinary network traffic no longer does it.
- Move automatic maintenance out of the night. Search for Change automatic maintenance settings and set the daily maintenance time to an hour when the PC being awake does not matter, or clear the option that lets it wake the PC to run.
The advanced route
- List everything allowed to wake the PC. In Windows Terminal, run
powercfg /devicequery wake_armed. Work through the list in Device Manager and clear the wake permission on anything you do not deliberately use to wake the machine. Microsoft documents the powercfg options in Powercfg command-line options. - Find the scheduled task behind a wake timer. Run
powercfg /waketimersas administrator to see active wake timers and the task that set each one. Open that task in Task Scheduler and clear Wake the computer to run this task in its Conditions tab, rather than deleting the task itself. - Check the BIOS wake settings. If the wake source stays unknown, restart into the BIOS or UEFI setup and look for wake-on-LAN, wake on a schedule, or power-on-by-alarm options. A firmware alarm wakes the PC before Windows is involved, so no Windows setting can stop it.
End state
- The PC stays asleep through a full night, fans off and screen dark, until you wake it.
powercfg /lastwakeafter you wake it names the power button or your keyboard, not a timer or device.powercfg /devicequery wake_armedlists only devices you chose to leave armed.
When it goes wrong
- The wake history says Unknown. The wake came from firmware or from power being restored. Check the BIOS wake options, and note whether the wakes follow power cuts or a smart plug's schedule.
- It wakes the moment it sleeps. A device is firing immediately — usually a Bluetooth device or a faulty USB peripheral. Unplug or switch off one device per night until the instant wakes stop.
- A task re-arms its wake timer after an update. Some tasks restore their settings when their app updates. Re-clear the task's wake option, and keep wake timers disabled at the power-plan level as the backstop.
- The PC wakes and never sleeps again. That is a different fault: something is holding the PC awake after the wake. Fix the wake source first, then check what keeps it up.
Related fixes
-
Fix a PC that turns itself back on after you shut it down
A PC that restarts itself after shutdown is almost always being woken, not haunted: a wake timer, a network card allowed to wake it, or Fast Startup turning shutdown into a kind of hibernate. Find which wake source fired, then turn that one off.
-
Fix Night light that will not turn on, or stays on all day
Night light that refuses to turn on — or never turns off — is usually its schedule, a location setting it depends on for sunset times, or the graphics driver that applies the color shift. Clear the schedule first, restore the location permission next, and update the driver only if the toggle itself is grayed out or ignored.
-
Fix a PC that freezes for a few seconds every time a drive wakes
A freeze of a few seconds that always ends on its own — often with a faint click or spin-up sound — is a sleeping drive waking up while Windows waits for it. Raise the drive sleep timeout first so the drive stops dropping out mid-session, and treat a drive that takes longer and longer to wake as a health warning.
-
Fix a DisplayPort monitor that is not detected after the PC wakes
DisplayPort monitors that vanish after sleep are usually caught in a handshake failure: the PC wakes, asks for the display, and the monitor answers too slowly or not at all. Wake the monitor first in the right order, reseat the cable next, then change the settings that govern the handshake.
Sources
- Microsoft Learn, Powercfg command-line options — the /lastwake, /waketimers, and /devicequery options for finding what woke the PC and what is allowed to.
- Microsoft Support, Shut down, sleep, or hibernate your PC — how sleep and hibernate work and where their settings live.