0

I'm trying to hibernate my PC after a number of seconds (as I can't see a command to sleep, which would be best).

These work:

shutdown /h
shutdown /s /t 5

However, this one doesn't:

shutdown /h /t 5  

Which should hibernate after 5 seconds, all I get is:

C:\WINDOWS\system32>shutdown /h /t 5
Usage: shutdown [/i | /l | /s | /sg | /r | /g | /a | /p | /h | /e | /o] [/hybrid] [/soft] [/fw] [/f]
    [/m \\computer][/t xxx][/d [p|u:]xx:yy [/c "comment"]]

    No args    Display help. This is the same as typing /?.
    /?         Display help. This is the same as not typing any options.
    /i         Display the graphical user interface (GUI).
               This must be the first option.
    /l         Log off. This cannot be used with /m or /d options.
...and so on

Can anyone explain why shutdown /h /t 5 is not working?

Mokubai
  • 89,133
  • 25
  • 207
  • 233
Antonio23249
  • 821
  • 1
  • 8
  • 22
  • The shutdown command may not be what you want. There are options at https://superuser.com/questions/259791/how-can-i-use-the-shutdown-command-to-hibernate-the-computer-in-x-hours as well as https://superuser.com/questions/83437/hibernate-computer-with-a-timeout-from-command-line-on-windows-7 and probably your best option is combining the hibernate with a delay. The second duplicate suggests `ping -n 20 127.0.0.1 > NUL 2>&1 && shutdown /h /f` and changing the -n 20 to whatever time in seconds you want. – Mokubai Jan 16 '22 at 12:09
  • Fantastic, that works! Thank you Mokubai! – Antonio23249 Jan 16 '22 at 12:42

0 Answers0