Check for Wake Devices in the Command Prompt
To figure out why your computer randomly turns on, you can first use a few Command Prompt commands to get an idea of what’s going on.
To open a Command Prompt, right-click on the Start button (or press Win + X) to open the power user menu. There, select Command Prompt (or Windows PowerShell; either will work). Enter the following command:
This will show you the last device that woke your PC up from sleep. if you see something like Wake History Count – 0 as in the screenshot below, Windows doesn’t have a record of what it was. This can happen if you just rebooted your PC.
Next, you should try the following command:
powercfg –devicequery wake_armed
This one displays all the devices that are allowed to wake your PC from sleep. It’s common to see your mouse and keyboard listed here.
If you don’t want a device to have the authority to wake up your PC, use the following command to disable it, replacing the text in brackets with the name of the device. We look at a more user-friendly way to do this below.
powercfg -devicedisablewake [DEVICE NAME]
Review More Sleep Info in Event Viewer
For a bit more information on the latest sleep event, you can open the Event Viewer in Windows. Search for it in the Start menu for easy access; once it’s open, select Windows Logs > System in the left sidebar. From there, click Filter Current Log in the right sidebar.
In the filter window, click inside the Event sources box and select Power-Troubleshooter. You can use the Logged dropdown at the top to set a time frame if you want, then hit OK.
After this, you’ll see a list of events showing when Windows woke up from sleep. Select one to get more info about it, including exactly when it happened. Check the Wake Source inside the box to see what caused it. This may say Unknown, which obviously isn’t much help. But if there’s a specific cause here, you’ll know what to look for going forward.
Use the Device Manager to Disable Wake-Ups
Using the information you gained from the Command Prompt and Event Viewer, you can now hopefully prevent your computer from turning on during sleep mode through the Device Manager. To open it, right-click the Start button (or press Win + X) and choose Device Manager from the list.
This utility shows all devices connected to your PC, but not all of these have the ability to wake up your computer. You’ll want to check the ones revealed by the commands above. Devices under Keyboards, Mice and other pointing devices, and Human Interface Devices are the most common culprits.
Expand those lists and double-click on an entry to open its Properties window. If there’s more than one entry, you may have to check each one individually. Unfortunately, devices don’t always include their model name, and you’ll likely see multiple devices if you’ve connected more than one in the past.
In the Properties window for your device, you should see a Power Management tab at the top. Select this, then uncheck the Allow this device to wake the computer box and hit OK. This prevents your mouse, keyboard, or other device from waking up Windows from sleep.
Repeat this process for any devices that you also want to disable. While you most likely won’t bump your keyboard by accident (unless your pet activates it), the mouse is a much more common problem. A particularly sensitive mouse can wake up your computer from a small shake of your desk or the floor. Thus, it’s a good idea to prevent your mouse from waking up the PC.
Even if you disable every device’s ability to wake up your computer from sleep, you can still wake it up using the power button. It’s up to you whether you want to keep another device enabled for this purpose. For troubleshooting purposes, it’s best to disable everything to start.