What's new

Putting Surface into Sleep mode programmatically (Windows 10)

newbieforever

New Member
An old problem, maybe (?) resolved for older Windows version, but not for Windows 10!

The solutions proposed in old discussions (... SetSuspendState with parameters 0,1,0 (or Sleep), with or without prior hibernate off ...) dont work on Windows 10 systems. At least not on all: On my Surface 3 all these attempts initiate a state which definitely isn't the sleep mode. (I know this because my Surface is set to Sleep for power-button and lid-close action.)

What I found out: In older Windows versions there was something like this in the Registry: [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\sleep\command] @="rundll32.exe powrprof.dll,SetSuspendState Sleep" This obviously was the sleep command. At least on my Windows 10 Surface 3 there is no such entry!

Somebody here with new answers?

By the way: Wouldn't it be high time for Microsoft to address this issue?

EDITED: After this my OP I discovered that this is not a Windows 10 issue, it is a Surface 3 issue, related to the power option used on Surface 3 as Sleep mode:
The Sleep mode used by Surface 3 seems to be "Modern Standby" = "S0 Low Power Idle" = "Connected Network Standby".
The commands using SetSuspendState seems to be unable at all to initiate the Sleep mode on a Surface 3.

A new wording for my question: All what I would like to have is a command which does the same as the Power button on a Surface 3 which is set to "power-button action = Sleep", or as the Sleep button on an external keyboard when Surface 3 is set to "sleep-button action = Sleep".
 
Last edited:

Garyjk

Member
i have keyboard with programmable macro keys. i set one of the them to put my computer to sleep. it's works in every version of windows 10 i'vc tried, and i'm now on build 14986. never tried it on my surface 3 yet. i just use a shortcut on my desktop to "C:\Windows\System32\SlideToShutDown.exe"

here's what i set the keyboard macro to:
rundll32.exe powrprof.dll,SetSuspendState
 
OP
N

newbieforever

New Member
EDITED: After this my OP I discovered that this is not a Windows 10 issue, it is a Surface 3 issue, related to the power option used on Surface 3 as Sleep mode:

The Sleep mode used by Surface 3 seems to be "Modern Standby" = "S0 Low Power Idle" = "Connected Network Standby". (Not the usual S3 Sleep mode!!!)

The commands using SetSuspendState seems to be unable at all to initiate the Sleep mode on a Surface 3.

A new wording for my question: All what I would like to have is a command which does the same as the Power button on a Surface 3 which is set to "power-button action = Sleep", or as the Sleep button on an external (USB) keyboard when Surface 3 is set to "sleep-button action = Sleep".
 
Last edited:

jnjroach

Administrator
Staff member
Connected Standby (S0iX) is an S0 power state and not Sleep State.... the machine is still on but in a low power configuration. On S0iX Machines you could use Hibernate S4.
 
OP
N

newbieforever

New Member
is an S0 power state and not Sleep State..

I appologize, but this is somehow irrelevant, and it is not (fully) correct too. The point is that on Surface 3 you can set the power option "Sleep", and Surface 3 in this case uses the above mentioned mode (which in this sense is a "Sleep mode").

Anyway, in the context of my problem this is only a terminological question. I would like to have a command which ...
 

Members online

Top