21

Possible Duplicate: How can I put the computer to sleep from Command Prompt/Run menu in Windows Vista?

A few days ago I installed Windows 8. I first found the lack of the "shutdown" menu comical, but now it's starting to annoy me. There seems to be no normal way to put my computer to sleep. The closest I found was:

  1. Ctrl + Del + Del
  2. 2x Shift + Tab
  3. Enter
  4. Arrow down
  5. Enter

As an alternative, I'm now looking for a command line tool to put Windows 8 to sleep.

The closest I could find was:

shutdown /h

Which causes Windows to hibernate. Unfortunately, hibernate isn't sleep. You can't wake a computer from hibernation with a key: you have to press the power button. And the computer will go through the BIOS startup before waking from hibernation.

Has anyone found a convenient way to put Windows 8 to sleep?

| improve this question | |
  • 1
    @techie007: The accepted answer for that question does not list a working way to Sleep, as you can read in the comments. The psshutdown -d -t 0 command posted by Scott Chamberlain does work. – Andomar Aug 19 '12 at 18:49
  • 1
    Just because the accepted answer isn't what you want, doesn't make it a different question. Scott Chamberland's "comment" on the other question is actually another answer. And you should up-vote it if you found it to be useful. :) – Ƭᴇcʜιᴇ007 Aug 19 '12 at 18:50
  • @techie007: Sounds like you're misreading "command" for "comment" in my comment. And I did of course upvote his answer :) – Andomar Aug 19 '12 at 18:55
  • You are correct, I thought it said Comment. :) – Ƭᴇcʜιᴇ007 Aug 19 '12 at 18:57
  • 1
    @dumbledad: It's part of the Sysinternals tools from Microsoft. – Andomar May 2 '13 at 18:00
26

Here are all of the power options, I hope you find these useful.

  • Shutdown:

    %windir%\System32\shutdown.exe -s
    
  • Reboot:

    %windir%\System32\shutdown.exe -r
    
  • Logoff:

    %windir%\System32\shutdown.exe -l
    
  • Standby (disable hibernation, execute the standby command, then re-enable hibernation after 2 seconds):

    powercfg -hibernate off  &&  start /min "" %windir%\System32\rundll32.exe powrprof.dll,SetSuspendState Standby  &&  ping -n 3 127.0.0.1  &&  powercfg -hibernate on
    
  • Sleep (same method as STANDBY, but this command):

    %windir%\System32\rundll32.exe powrprof.dll,SetSuspendState 0,1,0
    
  • Hibernate:

    %windir%\System32\rundll32.exe powrprof.dll,SetSuspendState Hibernate
    
| improve this answer | |
11

This question was answered by Scott Chamberlain in this answer. You can use the psshutdown tool from the Sysinternals Suite to put Windows 8 to sleep:

psshutdown -d -t 0

You can download the tool only or the entire suite.

These two suggestions won't work if hibernation is enabled:

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

The question which Scott Chamberlain answered is for Vista, perhaps having a Windows 8 version is useful, at least for locating the original :)

| improve this answer | |
2

I first found the lack of the "shutdown" menu comical

Windows 8 has a shutdown menu!

It's power icon under the "Settings" fly-out (move your mouse into a corner to see the fly-outs). You can use the Windows Key + i keyboard shortcut to bring up the settings fly-out directly. In summary:

  1. WinKey + i
  2. Click "Power"
  3. Click "Sleep"

Alternatively, pretty much any laptop made in the last 6 years can set the power button to put the computer to sleep on one press.

| improve this answer | |
  • Sleeping through the power icon requires 4 mouse or 6 keys clicks. Since I sleep my computer often I found that too cumbersome (not to mention error prone.) – Andomar Aug 19 '12 at 19:31
  • 1
    @Andomar I see 3 clicks (same as in windows 7) – soandos Aug 19 '12 at 19:31
  • @soandos: I think "move to corner" is at least as much work as a click. Win7 was Ctrl-Esc Right-Arrow Enter, which flows nicely on the keyboard. It's a workstation, not a laptop. – Andomar Aug 19 '12 at 19:36
  • 1
    Workstations have had the option to set the power button to sleep for even longer -- just not universally, and you may need to go into the bios to enable it. Alternatively, get a multimedia keyboard with a sleep button. – Joel Coehoorn Aug 19 '12 at 19:38
  • 1
    @andomar - you don't have to program it. Most multimedia keyboards come with a pre-programmed sleep button. – Joel Coehoorn Aug 19 '12 at 19:44
0

Not sure about Windows 8 but under Windows 7 you can in the "Power Options" use the "Change what the power buttons do" to set the main power button to put the computer to sleep instead of turning it off.

enter image description here

| improve this answer | |
-2

I've found that the shut down and sleep options are right there in the Windows orb (aka "start button"). If you modify the power settings you can probably also enable/disable hibernation functions too (if it isn't already).

But really. You may have to enable the S1 or S3 power configuration in your BIOS in order for sleep to properly work. There may be other settings too! You may even need to check your power supplies ability since it is possible to actually shut down even though you're actually trying to put the system to sleep. And the reason that might happen is because there might not be enough current on the 5V rail which is necessary to keep the RAM and RAM circuitry alive in a true sleep condition. (Now you know why it's so dangerous to plug/unplug expansion cards or add/remove RAM modules when power cord is still plugged in.)

Otherwise, hibernation and possibly enabling WOL (Wake On LAN) might work? But WOL would require a router capable of handling those "special" packets. Hibernation also doesn't allow a system to wake on a particular event such as if you were scheduling WMC to record a television show or even if you wanted to schedule Windows to defrag itself at 3:00AM. Hibernation is really only good for booting fast. You'll still go through the BIOS POSTing and all, but then Windows will appear to almost instantly turn on since the RAM is essentially reloaded from a huge temporary file on the HDD (this is really more for laptops when you think about it).

Anyway, good luck. I think the reply from "superuser" is more than adequate for your immediate question of what command to use. Although, I might have just created a shortcut and possibly used this for the command: Rundll32.exe Powrprof.dll,SetSuspendState Sleep (Here's a link where I think I saw it: http://answers.microsoft.com/en-us/windows/forum/windows_vista-desktop/is-there-any-way-to-make-a-desktop-shortcut-for/4e57f536-50a8-4942-a84a-290b3dea1ffb )

| improve this answer | |
  • My computer sleeps just fine. It's just that it's too hard telling it to sleep. The SetSuspendState Sleep suffers from the same problem as the other suggestions: it will prefer hibernation to sleep. (Not my downvote, thanks for your reply.) – Andomar Aug 19 '12 at 19:34
  • He's talking windows 8. There is no "windows orb" any more. – Joel Coehoorn Aug 19 '12 at 19:37

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