Prevent all devices from waking my computer
You can disable all devices from waking your computer with powershell -Command "powercfg /devicequery wake_armed | ForEach{ powercfg /devicedisablewake $_ }"
.
In cmd
, you can run powercfg /devicequery wake_armed
to get a list of the devices that are currently allowed to wake up your computer. Chances are you’ll see a couple HIDs (human interface device) and maybe a network card. You can copy/paste these into the corresponding command, powercfg /devicedisablewake "your device here"
, but that’s annoying.
The ForEach{ $_ }
operates a bit like xargs
if you’re familiar with that, where $_
is a placeholder for the text in each line of the input (i.e. the powercfg /devicequery wake_armed
before the pipe).