lang/ps/ PowerManagement
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 $_ }
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.