Is there a command line tool to put Windows 8 to sleep? [duplicate]

Solution 1:

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
    

Solution 2:

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