Controlling which devices will wake the computer out of sleep

I haven't experienced this problem, but I know of people who have. They'll put their laptop into suspend or standby mode, and after a few seconds, the laptop will spontaneously wake itself up. Someone gave me this tip that might (might) help you figure out what is wrong.

Open a command prompt and run the command

powercfg -devicequery wake_from_any

This lists all the hardware devices that are capable of waking up the computer from standby. But the operating system typically ignores most of them. To see the ones that are not being ignored, run the command

powercfg -devicequery wake_armed

This second list is typically much shorter. On my computer, it listed just the keyboard, the mouse, and the modem. (The modem? I never use that thing!)

You can disable each of these devices one by one until you find the one that is waking up the computer.

powercfg -devicedisablewake "device name"

(How is this different from unchecking Allow this device to wake the computer from the device properties in Device Manager? Beats me.)

Once you find the one that is causing problems, you can re-enable the others.

powercfg -deviceenablewake "device name"

I would start by disabling wake-up for the keyboard and mouse. Maybe the optical mouse is detecting tiny vibrations in your room. Or the device might simply be "chatty", generating activity even though you aren't touching it.

This may not solve your problem, but at least's something you can try. I've never actually tried it myself, so who knows whether it works.

Exercise: Count how many disclaimers there are in this article, and predict how many people will ignore them.

Comments (62)
  1. Anonymous says:

    How about six?  Do I get a cookie if I’m right?

  2. Anonymous says:

    Thanks, I will try that out at home.

  3. Anonymous says:

    I haven’t experienced this problem, <- that’s one

    might (might) <- number 2 and 3

    typically ignores <- number 4 you might not be typical :)

    typically much shoter <- 5, it might even be longer ??? ;)

    I would start by <- 6

    Maybe the optical … might simply be <-7&8

    This may not solve your problem, but at least’s something you can try. I’ve never actually tried it myself, so who knows whether it works. <- 9 (or counting each of them separately 9,10,11 and 12)

    oh and for the ignore count I would say

    300-(disclamercount*17.5) = :)

    (okay I had my fun now prove me wrong :):) )

  4. Anonymous says:

    Behold the power of the command line! Your puny device manager check boxes cannot stop me!

  5. Anonymous says:

    Hm? This syntax doesn’t work here on Windows Server 2003, so I presume this is Vista-only (and therefore useless) stuff.

  6. Anonymous says:

    anonymous: Nope, it works just fine on my XP Pro SP2, but it might be specific for client systems. (Remember 2003 is really a server system.)

  7. Vista-only (and therefore useless)

    You’re missing a caveat or two there:

    Vista-only (and therefore useless [except on Vista {and maybe future versions of Windows}])

  8. Anonymous says:

    anonymous:  Hmmmm turning sleep mode on, on a server – smart….

    Make sure you have the screen saver setup with a nice heavy screensaver as well!

  9. Anonymous says:

    Anonymous: You’re using a laptop as a server?  And interested in the power management functions?  Interesting setup.

  10. Anonymous says:

    > anonymous:  Hmmmm turning sleep mode on, on a server – smart….

    We use Win2003 on both laptops and workstation for many needs. No limits on open listening sockets, no stupidities on remote desktops, etc.

  11. Anonymous says:

    I’ve never been able to get a non laptop to wake from sleep using the power button.  Is there something you have to do to get an ATX power switch to wake from sleep?

  12. Anonymous says:

    In defense of anonymous:

    I personally would love to have an auto-sleep server that auto-wakes when I need it. That is, the network card wakes it up when it gets traffic directed to him (something a little less clutsy than "magic packet" in established WOL implementations.)

    Microsoft is now pushing a home server product, aren’t they? I’d like to share photos and music across computers with a central repository and I wouldn’t mind waiting the 30 seconds for a computer to come out of standby compared to the power savings of the 22 hours a day of idling in a closet somewhere.

    This post has encouraged me to do additional research. Thanks Raymond!

  13. Anonymous says:

    nice!, thanks for the tip, now I can fix my gf… eerr… wife computer =o)

  14. Anonymous says:

    These commands seem to work on my XP SP2 laptop. Also, I know many people who use Server 2003 on a laptop, since they need to develop on it (IIS6, etc). It’s not bad at all actually.

    It would be nice if there was an event log saying “Windows waked up because of device X”.

    [Oh, you mean powercfg -lastwake? -Raymond]
  15. Anonymous says:

    ERock – my Dell has an Intel Pro/100 VE for which Intel provides a driver download that adds property pages to the network card configuration dialogs where you can enable "Wake on Directed Packet" in the Power Management tab. (Network Connections|Properties|Configure…|Power Management).

    Confused me when my wife’s computer used to start up when I opened Windows Explorer and browsed my Network Connections :-)

  16. Dean Harding says:

    I just tried it, and mine has "High Definition Audio Controller" as one of the wake_armed devices… does that mean I could actually say "wake, computer!" into the microphone and it’ll wake up? Man, that’d be cool!! Too bad I don’t have a microphone to try it out ;-)

  17. Anonymous says:

    Thank you, thank you!  I’ve been struggling with this forever and couldn’t find anything like this article.  Finally remembering on "Wake On LAN" and disabling it helped immensely, but it’s not perfect.

  18. Anonymous says:

    anonymous thus spoke: "Hm? This syntax doesn’t work here on Windows Server 2003, so I presume this is Vista-only (and therefore useless) stuff."

    Neils repsonded with "…(Remember 2003 is really a server system.)"

    So Neils, I’m just curious what gave it away? it couldn’t have been the word "Server" in the title could it?

  19. Anonymous says:

    A few issues with Vista I have noticed.

    If you put it on standby when its plugged in, and then unplug it, it will use the plugged in settings (and so rather than hibernate after 2 hours, it will be something like 12 hours).

    If you have Vista set to go on standby when you shut the lid, and you click shutdown (yes, a real shutdown) but close the lid before it finishes, it will go onto standby and when you open the lid it will resume its shutdown :)

    There are some settings that can cause it to wake, the scheduled tasks and media centre program updates. I found the automatic backup tool woke my laptop (not good when its in a bag!).

    These may be specific to me, but hopefully if you didn’t already know, you might find it helpful. I can now pretty much count on my laptop staying on standby when I ask it to.

  20. Anonymous says:

    Very handy tip, thanks!  It’s been annoying me for quite a while that my system will auto-wake itself unless I wait several seconds after rolling the keyboard/mouse away before hitting the sleep button.  I’m certain the optical mouse is the culprit (since it’s about the same amount of delay before it turns its LED off), but I’ve looked in Device Manager and it doesn’t have an option to stop the mouse waking the computer.

    Hopefully this will do the trick :)

  21. Anonymous says:


    That’s a cool idea … You must try it …

  22. Anonymous says:

    Thanks for that.  You’ve helped at least one person prevent their laptop from waking up unexpectedly :D

    That command also allows you to remove options (at least in vista).  I used powercfg -H off to remove the hibernate option from my laptop.  It was causing me problems and removing the temptation was just what I needed.

  23. Anonymous says:

    (How is this different from unchecking Allow this device to wake the computer from the device properties in Device Manager? Beats me.)

    A cryptic command makes it seem more like you’re learning the secret handshake from one of the Secret Brotherhood of the Machine instead of being told to actually read an options dialog instead of gloss over it.  :)

  24. Anonymous says:

    Hmm, I only have "High Definition Audio Controller" listed on the second command for my Dell Inspiron laptop. Weird.

  25. Anonymous says:

    /* I would start by disabling wake-up for the keyboard and mouse.


    Then how would you wake up the computer once you’ve determined this is the cause?  You’re going to want at least one of those devices listening for “wake up events.”

    [Um, the power button? -Raymond]
  26. Anonymous says:

    It seems that the XP Pro x64 version of powercfg is quite a bit different.  It is probably similar to the Server 2003 versions.  If nothing else, -devicequery doesn’t seem to be supported.

    I’m bummed, since this has been one of those annoyances that I’ve never had a chance to knock down.  I was so /hopeful/!!  

    Still, thank you very much for letting us know about this one.  I love it where there are powerful tools already on my computer!

  27. Igor Levicki says:

    I can confirm that powercfg that comes with X64 XP is useless. Raymnod you missed a disclaimer :)

    [I get the feeling that you won’t be satisfied until the article is 90% disclaimer. -Raymond]
  28. JamesNT says:


    I would appreciate your elaboration on how the powercfg that comes with 64-bit XP is useless.  It’s not enough to just make broad statements that confer no fact or reason – unless you are just trying to piss of Raymond.  I wish you people would stop doing that and recognize this blog for the great resource it is.


  29. Anonymous says:

    Funny, on my Sony UMPC, I get practically every peripheral (USB, LAN, touch, fingerprint, WiFi, Bluetooth, etc) except keyboard (thumbboard), which I know wakes it.

    Doing it with wake_armed returns zip. Yet I always wake it up via the keyboard (easier target than power switch). Strange.

    Oh well – it only lasts about 20 hours on sleep anyhow – you really need to hibernate it.

  30. Anonymous says:


    on my XP SP2 then -LASTWAKE doesn’t work (weird syntax also, as powercfg seems to take arguments with / instead of -).

    THe /? didn’t list any optionsremotely sounding like LASTWAKE either :(

    powercfg -LASTWAKE

    Invalid Parameters — try "/?" for help

  31. Anonymous says:

    Nuts.  Just got home and tried it, but I’m on XP64 too, so no joy.  POWERCFG here only has options for the same stuff that’s in the GUI (power schemes, timeouts, etc) — which doesn’t include any per-device options.  Sigh.

  32. Anonymous says:

    I’m sorry that there are people out there that make you have to type these: "I haven’t experienced this problem", "might help", "typically ignores", "typically much shorter", "Beats me", "Maybe the optical mouse", "might simply be chatty", "This may not solve your problem", "I’ve never actually tried it myself", "who knows"

  33. BryanK says:

    To everyone using XP x64:

    The reason it doesn’t work on your OS is because your OS is really just Server 2003’s x64 version, re-branded and with a few extra limitations re-added (like the number of incoming connections allowed).  Check out the OS minor and build version numbers, as they get put into AD’s LDAP tree by the OS itself (in the operatingSystemVersion attribute of the computer object) sometime, and compare them to Server 2003 — notice how they’re exactly the same.

    (I think you can get the same info from GetOSVersionInfo, but I’ve never checked that myself.)

  34. Anonymous says:

    Contentfree linkfarms seem to be abusing the pingback facility on this blog.

    I was quite impressed when clicking button on my USB mouse took my Vista laptop out of sleep mode. I know USB has had remote wakeup for some time, good to see someone implemented support for it. And good to see you can turn it off if it annoys you.

    It reminds me of the cool soft power on button on the Mac keboard when PCs had a big clunky switch. And just like the PC is 2x superior to the Mac because it has two mouse buttons rather than one, now potentially every button is a power on button, which makes it up around 100x better ;-)

  35. Anonymous says:

    Fourteen, if you count soft-action phrases like "you can" and "I would."

  36. Anonymous says:

    Wow… pingback spam, where the source doesn’t have any content.  

  37. Igor Levicki says:

    JamesNT said: >>I would appreciate your elaboration on how the powercfg that comes with 64-bit XP is useless<<

    Of course:

    – It doesn’t have the same command options or syntax.

    POWERCFG [/LIST | /QUERY [name] | /CREATE name | /DELETE name |

          /SETACTIVE name | /CHANGE name settings |

          /HIBERNATE {ON|OFF} | /EXPORT name [/FILE filename] |

          /IMPORT name [/FILE filename] | /GLOBALPOWERFLAG {ON|OFF} /OPTION flag |

          /BATTERYALARM {LOW|CRITICAL} [settings] | /?]

    – Because of that, it doesn’t allow the sort of control Raymond described.

    Therefore, in the context of this article it is completely useless, because it cannot be used to accompilsh the same task. It is just a lousy duplicate of a Power Options control panel applet.

    Finally, I wasn’t trying to piss off Raymond — there is a smiley at the end of the sentence in my post meaning it was a joke.

    Unfortunately with all those disclaimers he did miss to mention that this post doesn’t apply to Windows XP x64 users.

    [I didn’t need to mention it because it was covered by the “this tip that might (might) help you” disclaimer and the “This may not solve your problem, but at least’s something you can try.” disclaimer. oh, by the way, these tips don’t work on a Mac either. Sorry I forgot to disclaim that. -Raymond]

    Sigh, next time I will write a disclaimer for my post.

  38. Anonymous says:

    powercfg -lastwake does not give the semantics one expects (on a Vista x86):

    PS C:WindowsSystem32> powercfg -lastwake

    Wake History Count – 1

    Wake History [0]

  39. Anonymous says:

    My Vista laptop used to wake up because Windows Update check up time by default was set to 3 AM. No power management was involved.

  40. Anonymous says:

    C:>powercfg -lastwake

    Invalid Parameters — try "/?" for help

    Running Windows XP Pro SP2 (Build 2600.xpsp.050622-1524). Is there some update I need to make this work?

    (/? Doesn’t list lastwake as a possible parameter either.)

  41. Anonymous says:

    "Unfortunately with all those disclaimers he did miss to mention that this post doesn’t apply to Windows XP x64 users."

    That was funny, except it was delivered without a smilie, so I assume it to be a serious statement.

    Why should Raymond have to mention this?

    Do you think he would have if he knew?

    Do you feel personally slighted that Raymond didn’t mention something he may or may not have known?

  42. Anonymous says:


    I tried the powercfg command to find which device was waking my system when I put it in standby.

    No luck, it stays in standby when I remove all devices from the wake_armed list. As soon as I add one back, the system doesn’t stay in standby.

    At least, the powerbutton works to wake it up!

    Any idea someone?


  43. Thanks. I will try that on my test computer.

Comments are closed.