2

I know how to disable it for a single mouse. The problem is that I have to do that each time for each mouse and for each USB port. That is, if I disable it for a mouse, and plug it into another USB port, I have to disable it again.

Is it possible to disable wake from all mice, no matter which the USB port it is plugged into or what mouse it is?

Damn Vegetables
  • 4,308
  • 19
  • 60
  • 98

1 Answers1

0

This question seems to have been answered in another 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.
  pause
) else (
  echo Usage: %~nx0
)