DEV Community

Bryz︱🦾
Bryz︱🦾

Posted on

😴 Laptop Won't Sleep (or Wakes Up at 3 AM)? Ask Windows Who Did It

You close the lid, walk away, and come back to a hot laptop and a dead battery. 🔥 Or a desktop that wakes itself up in the middle of the night like it has somewhere to be. 👻

Before you start flipping random power settings, ask Windows directly. It keeps track of what woke the PC and what's keeping it awake. Here's the quick help desk flow.

🔍 Step 1: Find out what woke it up

Open Command Prompt or PowerShell and run:

powercfg /lastwake
Enter fullscreen mode Exit fullscreen mode

This shows the source of the most recent wake: a device (like a mouse or network adapter), a wake timer, or the power button. Now you're troubleshooting a real culprit, not a guess.

🚫 Step 2: See what's blocking sleep

If the PC won't go to sleep at all, open an elevated prompt (Run as administrator) and run:

powercfg /requests
Enter fullscreen mode Exit fullscreen mode

Look under DISPLAY, SYSTEM, and EXECUTION. Common offenders:

  • 🎵 A browser tab or app still playing audio or video
  • 📂 An active file share or sync connection
  • 🧩 A driver that keeps a request open

Close or fix the app it names, then try sleep again.

⚡ Step 3: Stop the repeat offenders

List every device that's allowed to wake the machine:

powercfg /devicequery wake_armed
Enter fullscreen mode Exit fullscreen mode

If a jumpy mouse or the network adapter is waking the PC, open Device Manager, find the device, go to Properties > Power Management, and uncheck Allow this device to wake the computer. You can also do it from the command line (admin):

powercfg /devicedisablewake "Exact device name from the list"
Enter fullscreen mode Exit fullscreen mode

Then check for scheduled wakes, like updates or maintenance tasks:

powercfg /waketimers
Enter fullscreen mode Exit fullscreen mode

If timers are the problem, review the task it names, or adjust Control Panel > Power Options > Change plan settings > Change advanced power settings > Sleep > Allow wake timers. In a managed environment, check with your team first, since some wakes are there on purpose for patching. 🛠️

✅ The takeaway

  1. powercfg /lastwake tells you who woke it.
  2. powercfg /requests tells you what's keeping it awake.
  3. powercfg /devicequery wake_armed and /waketimers show who's allowed to wake it.

Ask Windows first. Change settings second. Your users (and their batteries) will thank you. 🔋

What's the weirdest thing you've ever caught waking up a PC? Drop it below 👇

Top comments (1)

Collapse
 
protagonistlabs profile image
Bogdan Tucu •

Good flow, asking Windows first saves a lot of guessing. Two more that help: powercfg /sleepstudy on Modern Standby laptops writes an HTML report of what kept the system active in each standby session, and powercfg /energy traces for 60 seconds and lists the devices and drivers that prevent idle. For the 3 AM wake-ups, scheduled tasks with "Wake the computer to run this task" ticked are a frequent culprit, and /waketimers names them.