Noticed that some computer would wake from sleep by touching the mouse or press a key on the keyboard? Or maybe you noticed that some computer simply don’t wake up? Want to know how it works and be able to configure this? Then this is the right post for you.
I hope you heard about the command tool POWERCFG.EXE, because this is the tool we will be using today.
First we want to know if the computer is configured to wake from any devices today, this could be devices like network adapter, keyboards and mice. So fire up a command prompt as administrator and write:
powercfg /devicequery /wake_armed
This will list all the devices that will wake your computer at the moment and could look like this
As you might already guessed, the computer will wake from NIC, mouse and keyboard. (For most network adapters there are additional configurations in the device manage settings for the NIC, there is an earlier post on this)
In this case I don’t want the keyboard to wake the computer up and simply write this command:
powercfg /devicedisablewake “HID Keyboard Device”
Looking at the wake_armed list again and we will see that the Keyboard is gone
Let’s try, I put my computer to sleep and try to hit all the keys available on the keyboard, but the computer will not wake up, instead I go press the mouse button and the computer wakes up as excepted. We can even see what woke my computer up the last time (also perfect for troubleshooting unwanted wakes). Write:
and that looks like this
I enable the keyboard as a wake device again with the parameter deviceEnablewake:
powercfg /deviceenablewake “HID Keyboard Device”
Put the computer to sleep and I am back were I started and the computer will wake up if I press any key and lastwake parameter will confirm this
and when I query for wake_armed devices again the keyboard is back
What about adding other devices? You can list all devices that are able to be wake enabled by writing this:
powercfg /devicequery wake_programmable
In my case there are no more devices that could wake up the computer, but the device list could look like this and to enable wake for a device you use the /DeviceEnableWake paramenter and the name of the device listed, like I did in the example above
I hope that would spread some light on the wake device feature in Windows 7 and 8 and help you with your troubleshooting!
One last thing, Powercfg Command-Line Options TechNet article