Dup Ver Goto 📝

Windows CLI Power Management

PT2/windows/power windows power does not exist
To
38 lines, 199 words, 1598 chars Page 'PowerManagement' does not exist.

See which devices can wake the machine

powercfg /devicequery wake_armed

Prevent all HID devices from waking the machine.

powercfg /devicequery wake_armed | select-string -pattern "HID" | foreach { powercfg /devicedisablewake $_ }

Selecting Power Mode

> powercfg /l

Existing Power Schemes (* Active)
-----------------------------------
Power Scheme GUID: 381b4222-f694-41f0-9685-ff5bb260df2e  (Balanced) *
Power Scheme GUID: 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c  (High performance)
Power Scheme GUID: a1841308-3541-4fab-bc81-f71556f20b4a  (Power saver)

Note the GUID, so for example to select "HighP performance", we can then use

> powercfg /s 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c

Sleeping

There doesn't seem to be a way without disabling hibernation.

powercfg /H off
rundll32 powrprof.dll,SetSuspendState Sleep

(if hibernation is enabled, the machine will hibernate instead of sleeping)

No Sleep Option

I did a fresh install of Windows 10 onto a Lenovo T470s. I hadn't installed the graphics driver (so Windows was using the 'Microsoft Basic Display Driver') and there was no option to sleep. Installing this driver (the file is named r0fiv17w.exe) fixed the issue. When I originally got this laptop (refurb off eBay), there was an older graphics driver installed which caused issues playing videos on e.g. Youtube.

External links

article at devblogs.microsoft.com