Skip to content

Help with custom Sleep command #1956

Answered by ge0rdi
fullklax asked this question in Q&A
Discussion options

You must be logged in to vote

I'd like to know the command used by OpenShell to put the PC to sleep (shown below), so I can use it in my script.

SetSuspendState API is used on standard machines:
SetSuspendState(FALSE, FALSE, FALSE);

On machines with connected standby there is NtPowerInformation used:
NtPowerInformation(ScreenOff, NULL, 0, NULL, 0);

Though you can also invoke Open-Shell's sleep command directly via:
"C:\Program Files\Open-Shell\StartMenu.exe" -cmd sleep

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@fullklax
Comment options

Answer selected by fullklax
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants