63
44
I want to put my Windows PC (Windows 7) into a sleep state via command line (so I can bind to macro button on keyboard).
The power button on the PC is setup to but the computer to sleep (but it's down on the floor and I'm too lazy to reach down) it exactly how I want it (sleeps using hybrid mode in case I loose power)
The sleep command on the shutdown menu also works.
most info I found says to use;
%windir%\system32\rundll32.exe PowrProf.dll, SetSuspendState 0,1,0
But this puts the computer in hibernate mode. I do have hibernate disabled but using hybrid sleep.
So, What is the command to use to put your computer to sleep (not hibernate)?
Related: http://superuser.com/questions/42124/how-can-i-put-the-computer-to-sleep-from-command-prompt-run-menu
– Nayuki – 2016-05-25T06:12:14.8435
rundll32.exe PowrProf.dll,SetSuspendState
is not recommended. It is dangerous. (Because it corrupts the stack, as it does not comply with the function signature demanded byRundll32
. Then unforeseeable bad things may happen, as Raymond Chen warns…) – Aaron Thoma – 2013-02-20T22:30:57.403