PC Sleep and PC Hibernate Shortcuts

This material was tested on Windows 7 64-bit Ultimate.

PC Sleep means that computer will stop and return upon touch of a keyboard or a mouse.

PC Hibernate means deeper sleep. Computer will stop and return back through a Windows Resume (you will see BIOS options) upon touching Power button on a front panel.

Everybody wants a shortcut for PS Sleep to save time on clicks.  Instead of 3 clicks Start – Shutdown – Sleep every time, let’s have just one click – Sleep.  There is a way to do that.  Please tell me, if this also works in Windows XP.  (Yes, it does, partially.)

 

PC Sleep Shortcut

For PC Sleep shortcut create a CMD file Sleep.cmd and place this code in it:

powercfg -h off
rundll32.exe powrprof.dll,SetSuspendState 0,1,0
powercfg -h on

Create a shortcut to this file.  Pick an icon using %SystemRoot%\system32\SHELL32.dll

Note: this batch file does NOT work on Windows Server 2008 R2.

For Windows 7 you have to go to shortcut Properties – Advanced and click Run as administrator check box.  If you do not, youc will go to Hibernate, and upon return you will see momentarily this error message:

You do not have permission to enable or disable the Hibernate feature

Of course, if you do that, you have to confirm your action through User Account Control every time you click on that shortcut:    Do you want to allow the following program to make changes to your computer? So 2 clicks saved, one click lost.

 

PC Hibernate Shortcut

For PC Hibernate you do not need a batch file.  Create a shortcut to this command:

Rundll32.exe Powrprof.dll,SetSuspendState Sleep

Note: this shortcut DOES also work on Windows Server 2008 R2.

You are done!  See, why to turn your mouse upside down in the comments.

(Visited 1,401 times, 3 visits today)

4 Comments

  1. Mouse continues to wake it up even though I set it not to!?
    To avoid this, I simply turn the mouse upside down. See, if it works for you.

  2. Hi again! Thanks, I actually got around this by using this: http://www.sevenforums.com/general-discussion/181431-creating-sleep-shortcut.html I never use hibernate but use sleep frequently so this works for me. I also set the power button to sleep, this way I just hit the button and leave without fooling with mouse: http://www.howtogeek.com/howto/windows-vista/change-the-windows-vista-power-buttons-to-shut-down/ You are right that the mouse wakes pc up and I have this feature disabled on mouse settings, but to no avail! Mouse continues to wake it up even though I set it not to! Any suggestions on how to get mouse to cooperate? Right now I turn it off or try not to bump it.

  3. Thank you for your comment.
    Everything you describe also happens on Windows 7 Ultimate.
    However it DOES go to sleep, if one does not touch the mouse.

    Microsoft doesn’t list “Power Options” on version distinction sheet (http://windows.microsoft.com/en-US/windows7/products/compare?T1=tab01), so I do not think the flavor of Windows is the matter here.

    Instead, most likely reason is some software that blocks the sleep.
    All this is very interesting. Let’s get to the bottom of this together.
    Did you try any of these suggestions:
    http://support.microsoft.com/kb/976877

    Also do you have any additional details about your system:
    – Does it go to sleep using Start button?
    – What virus scan do you use?
    Anything else that makes your system unique?

  4. Doesn’t work on windows 7 home version, even after you run as admin, user account control box comes up each time. And when you hit run the cmd box opens and closes real fast but no sleep! Any suggestions? (except an upgrade to ultimate, I’m on a budget! :))

Your question, correction or clarification Ваш вопрос, поправка или уточнение