28

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?

Andomar
  • 1,451
  • 3
  • 14
  • 24
  • 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
  • @DanielBeck: The other question is specifically marked Vista. It would not have solved my problem because the accepted answer is wrong (which makes it useless: nobody reads all answers & comments on a search.) I guess I'll be looking for a friendlier site for my windows 8 questions. – Andomar Aug 20 '12 at 05:48
  • I don't have psshutdown on my Win8 machine, or at least it is not recognised – dumbledad May 02 '13 at 17:57
  • 1
    @dumbledad: It's part of the [Sysinternals tools](http://technet.microsoft.com/en-us/sysinternals/bb842062.aspx) from Microsoft. – Andomar May 02 '13 at 18:00
  • On my win 8.1 psshutdown does not work. running "c:\Windows\System32>psshutdown -d -t 0" leads to ".....Error shutting down system: The request is not supported." – Asu Aug 16 '17 at 21:15
  • @asu psshutdown comes from the sysinternals suite, you have to download it – Andomar Aug 16 '17 at 21:18
  • @Andomar I have. It would have printed "'psshutdown' is not recognized as an internal or external command, operable program or batch file" if I didn't. In my previous comment I have quoted the actual output of psshutdown. Instructions do not say that the whole archive must be unzipped into e.g. system32, so I have only copied psshutdown there – Asu Aug 17 '17 at 23:45
  • @Asu: no need to put it in system32, you can run it from anywhere. "Not supported" probably means your setup doesn't support sleep. Your BIOS might have S1 turned off, you may not have a hibernate file, or many other things. – Andomar Aug 18 '17 at 08:03
  • @Andomar Probably the BIOS then. It has no options I can change with regards to sleep. It is Asus t100, which is technically a tablet. – Asu Aug 18 '17 at 11:59

5 Answers5

36

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
    
techraf
  • 4,852
  • 11
  • 24
  • 40
superuser
  • 4,007
  • 5
  • 25
  • 33
  • Thanks for your reply. For me, Standby is different from Sleep. Restarting from Standby requires pressing the power button and the BIOS routine. Restarting from Sleep requires pressing a key and is almost instant. – Andomar Aug 19 '12 at 18:43
  • I have added the Sleep command as well, but the thing is it will hibernate instead of sleep if you don't turn the hibernation off. – superuser Aug 19 '12 at 18:54
  • 2
    `rundll32` should not be used for calling `SetSuspendState` because its signature doesn't match the one expected by `rundll32`. See: https://support.microsoft.com/en-us/kb/164787 and https://msdn.microsoft.com/en-us/library/windows/desktop/aa373201(v=vs.85).aspx – SergeyT Jul 26 '16 at 01:02
  • what is the role of the ping? – g.pickardou Feb 20 '21 at 17:57
12

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 :)

Andomar
  • 1,451
  • 3
  • 14
  • 24
  • `rundll32` should not be used for calling `SetSuspendState` because its signature doesn't match the one expected by `rundll32`. See: https://support.microsoft.com/en-us/kb/164787 and https://msdn.microsoft.com/en-us/library/windows/desktop/aa373201(v=vs.85).aspx – SergeyT Jul 26 '16 at 01:05
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.

Joel Coehoorn
  • 28,098
  • 14
  • 88
  • 133
  • 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
  • I can't reach my workstation's power button without crawling under the desk. I don't see how a programmable keyboard would help-- I'd still need to know what command to make it run, when the key was hit. – Andomar Aug 19 '12 at 19:43
  • 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
  • On Windows 8.1 there are only two items in that dropdown thingie, "Shut down" and "Restart". It is missing "Sleep". – Peter Mortensen Aug 06 '15 at 17:54
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

Brian
  • 8,896
  • 23
  • 37
-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 )

Anonymous
  • 52
  • 1
  • 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