Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Every time I plug in a new mouse/keyboard or plug an existing one to a new USB port, I have to manually go to the device manager, go to the device's property page, and uncheck "Allow this device to wake the computer" on the "Power Management" page. enter image description here

Is it possible to set up a system policy in Windows 7, such that this box is not checked for new USB mice/keyboards by default?

Edit: If there's no way to set up such a system policy, is there at least a way to enumerate and disable USB wake on devices by using powercfg in a batch file?

Edit 2: This has to be possible to do at least using powercfg. powercfg devicequery wake_armed gives a list of all devices that can wake the system. Now how can I feed this list back to powercfg and have it disable the wake on the listed devices?

share|improve this question
You can disable this in some BIOS (Legacy and UEFI) – justbrowsing Aug 14 '13 at 1:46
My BIOS doesn't have such an option, unfortunately. – Duke Nukem Aug 14 '13 at 21:14
My BOIS also does not have this option. Please let us know if you found an answer -- I've been in the habit of turning off my power supply for years, and I'd really like to change that... – Allen Pestaluky Nov 28 '15 at 19:41
up vote 1 down vote accepted

Edit 2: Clarification

This answer does not solve the problem in question in its original wording. Disabling wake for all future devices does not seem to be possible. The solution in this answer only allows you to disable wake for all currently connected devices.

My original answer:

This question seems to have been answered in another SO answer

for /F "tokens=*" %%A in ('powercfg -devicequery wake_armed') do powercfg -devicedisablewake "%%A"

This needs to be run as an administrator.


To provide a more complete solution here is a script that requests administrator privileges before running the above loop. The admin rights are requested using a Microsoft powertoy (written in VisualBasic, unsurprisingly)

@echo off
if "%~1"=="" (
  elevate %0 do
) else if "%~1"=="do" (
  for /F "tokens=*" %%A in ('powercfg -devicequery wake_armed') do (
    if not "%%A"=="NONE" (
      echo Disabling %%A
      powercfg -devicedisablewake "%%A"
  echo All done.
) else (
  echo Usage: %~nx0
share|improve this answer
This will only disable the current configuration of USB devices, not all future configurations like the question asked for. For example, run this script, then unplug a mouse and plug it back in to a new port -- the mouse will now wake from sleep again unless this script is run again for the new USB device configuration. – Allen Pestaluky Nov 28 '15 at 19:34
@AllenPestaluky the question has edits which ask for at least a partial solution if the complete solution is not possible. My answer (and the answer I link to) is exactly the partial solution the OP is asking for. – SnakE Nov 29 '15 at 1:21
Thanks, this batch script does exactly what I wanted. I may try to find a way to automate this in the future. Would you happen to know if there's a way to do the powercfg calls through the Windows API, to avoid spawning separate processes? – Duke Nukem Jun 21 at 4:47
@DukeNukem No I'm not aware of such an API. I didn't do any research though so it might still exist. Also all these settings must be in the registry. So you can use the procmon powertoy to trace which registry locations are accessed by powercfg -devicequery wake_armed and write your own registry manipulation tool. – SnakE Jun 23 at 10:58

To answer the questions in your edits:

No, you can not use powercfg to enumerate devices to change the default wake behaviour of all future USB configurations like you asked in your original question.

I tried using the For /F "tokens=*" %%A in ('powercfg -devicequery wake_armed') do powercfg -devicedisablewake "%%A" script, but after plugging my USB device into a new port, it defaulted back to waking the computer.

I even tried enumerating the result of powercfg -devicequery wake_from_any, but it seems that you can only enumerate connected USB devices. Even the wake_from_any argument returns a different list each time you change the port your USB device is plugged into.

To to answer your original question:

I have no idea. I really want to know the answer to this, but I still haven't found an answer. If anyone can figure this out, you will be loved dearly! <3

share|improve this answer

This seems a known issue documentation can be found here Summary:

Workaround 1 (Recommended)

Plug the USB device into an Enhanced Host Controller Interface (EHCI) host controller.

Workaround 2

Disable the USB device's ability to wake the computer. To do this, follow these steps:

Click Start
Start button
, right-click Computer, and then click Manage.
In the User Account Control dialog box, click Continue.

User Account Control permission
If you are prompted for an administrator password or for a confirmation, type the password, or click Allow.
Click Device Manager, expand Universal Serial Bus controllers, right-click the device, and then click Properties.
Click the Power Management tab, disable the Allow this device to wake the computer check box, and then click OK.

Note We recommend that you use Workaround 1 because it preserves the wake functionality. When you use Workaround 2, USB devices cannot wake the computer. Additionally, the remote control power button for a Windows Media Center IR receiver cannot wake the computer.

share|improve this answer
Thanks for your answer, but the documentation you linked to is not the issue that I'm having. The steps you show in workaround 2 are exactly what I have to do every time I need to disable USB wake on a device. What I want is for this wake to be disabled by default so I don't have to do these steps every time, and I could not found any way to do that at all... – Duke Nukem Aug 17 '13 at 22:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .