31

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,511

5 Answers5

39

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,952
superuser
  • 4,247
13

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,511
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,637
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
  • 9,034
-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