Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a Microsoft keyboard that I just bought, but it has no sleep button. what it does have is 5 programmable keys that can open programs. I want to program one of the buttons to put the computer in standby mode (where the power light is flashing). what I am using right now is "Rundll32.exe Powrprof.dll,SetSuspendState Sleep" and "rundll32.exe powrprof.dll,SetSuspendState 0,1,0" but these do something different (the power light is off, not flashing) what would be a command that I would use to put the computer in standby mode?

share|improve this question
    
Ah, was hoping to be able to give an answer from the shutdown command-line program, but it looks like it only does hibernate, but not standby. –  eidylon Apr 18 '11 at 20:42
    
Shutdown -h can also hibernate the computer –  wullxz Apr 19 '11 at 6:06

3 Answers 3

up vote 7 down vote accepted

Shutdown

%windir%\System32\shutdown.exe -s

Reboot

%windir%\System32\shutdown.exe -r

Logoff

%windir%\System32\shutdown.exe -l

Standby

%windir%\System32\rundll32.exe powrprof.dll,SetSuspendState Standby

Hibernate

%windir%\System32\rundll32.exe powrprof.dll,SetSuspendState Hibernate
share|improve this answer
1  
There's no Turn On command? :-) –  Mehrdad Apr 19 '11 at 6:15
1  
Do not use rundll32 for functions that are not specifically designed as such. –  grawity Apr 19 '11 at 14:23
    
interesting @grawity observation! –  kokbira Apr 20 '11 at 19:17

I'm pretty sure you can find a PowerShell command to do that, save it on a script file and set your keyboard execute that.

Check on google for "Powershell Standby", this looks good.

share|improve this answer

You can also customise what the power button (the button you turn on your computer with) does. You can set it to cause hibernate, sleep or shutdown. This can be changed via power options.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.