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?

  • 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


%windir%\System32\shutdown.exe -s


%windir%\System32\shutdown.exe -r


%windir%\System32\shutdown.exe -l


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


%windir%\System32\rundll32.exe powrprof.dll,SetSuspendState Hibernate
  • 1
    There's no Turn On command? :-) – user541686 Apr 19 '11 at 6:15
  • 1
    Do not use rundll32 for functions that are not specifically designed as such. – user1686 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.


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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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