You put your PC to sleep, go to bed, and in the middle of the night the screen lights up and the fans spin. It's not haunted. Something told Windows to wake up: a mouse, a network adapter, a scheduled task, or an update. Windows has a free built-in tool called powercfg that tells you exactly what did it, so you can fix the cause instead of guessing.
Step 1: Ask Windows What Woke the PC
Do this right after the next surprise wake-up, before you put the PC back to sleep.
- Click Start, type cmd, right-click Command Prompt and choose Run as administrator.
- Type
powercfg /lastwakeand press Enter.
Microsoft describes this command as reporting "what woke the system from the last sleep transition." Look at the lines under Wake Source. You will usually see a device name (like a mouse, keyboard or network adapter) or a timer.
Step 2: See Which Devices Are Allowed to Wake It
Type powercfg /devicequery wake_armed and press Enter. This lists every device that is currently set to wake the computer from sleep. On many desktops you'll see the mouse, the keyboard and the network card. A sensitive mouse that gets bumped, or a network adapter that answers network traffic, is a very common cause of night-time wake-ups.
Step 3: Turn Off Wake for the Device Causing It
If one device keeps waking the PC, you can stop just that one. Copy its exact name from the list above and run:
powercfg /devicedisablewake "Exact Device Name"
Microsoft's documentation shows the same command in reverse, powercfg /deviceenableawake "Exact Device Name", so you can undo it anytime. Tip: keep the keyboard able to wake the PC so you can still wake it on purpose, and turn off the mouse or network adapter instead.
Prefer clicking? Open Device Manager, double-click the device, open the Power Management tab and uncheck Allow this device to wake the computer.
Step 4: Check Wake Timers
If the wake source says a timer, run powercfg /waketimers. Microsoft explains that when a wake timer expires it "wakes the system from sleep and hibernate states." The output shows which program or scheduled task set the timer. Common ones are Windows Update maintenance, backup software and other scheduled tasks.
To stop wake timers from waking the PC:
- Open Control Panel > Power Options > Change plan settings > Change advanced power settings.
- Expand Sleep > Allow wake timers and set it to Disable (or Important Wake Timers Only, if your PC shows that option).
Keep in mind: if you block wake timers, updates and backups that were scheduled for the night will run when you next use the PC instead.
Bonus: PC Won't Go to Sleep at All?
The opposite problem has its own command. Run powercfg /requests. Microsoft says it lists the app and driver "Power Requests" that "prevent the computer from automatically powering off the display or entering a low-power sleep mode." A stuck browser tab playing media, a game launcher or a sound driver often shows up here.
Quick Checklist
powercfg /lastwake- what woke it last timepowercfg /devicequery wake_armed- devices allowed to wake itpowercfg /devicedisablewake "name"- stop one device from waking itpowercfg /waketimers- scheduled timers that can wake itpowercfg /requests- what's keeping it awake
When to Bring It In
If the PC wakes up, restarts or shuts down by itself even after these steps, or turns on when it was fully off, the cause may be a BIOS setting, a failing power supply, a power button problem or a driver issue. Those are worth a proper diagnostic.
How MediaVision Can Help
- Find what's waking your PC or stopping it from sleeping
- Check BIOS power settings, drivers and the power supply
- Set up sleep, updates and backups so they work together
- Give you a clear, honest quote before any work starts
MediaVision Computer Repair
800 S Brookhurst St, Suite 1B3, Anaheim, CA 92804
Phone: (714) 888-5959
Book Now
Frequently Asked Questions
Is it safe to run powercfg?
Yes. /lastwake, /waketimers, /devicequery and /requests only show information. Only /devicedisablewake changes a setting, and you can undo it with /deviceenableawake.
Does this work on Windows 10?
Yes. These powercfg commands work on Windows 10 and Windows 11.
lastwake says "Unknown." Now what?
Check wake timers and the devices list anyway. If nothing shows up, the cause may be in the BIOS (for example a scheduled power-on or wake-on-LAN setting) or a hardware fault, and that's a good time to call us.