Home » Questions » Computers [ Ask a new question ]

Hibernate computer with a timeout from command line on Windows 7

Hibernate computer with a timeout from command line on Windows 7

I am trying to hibernate my computer from the command. I was using shutdown /s /t 20 to shutdown the the computer. I change /s to /h to hibernate and now it just returns the usage text as if it doesn't recognise what I have entered. In this is does say

Asked by: Guest | Views: 340
Total answers/comments: 5
Guest [Entry]

"I don't believe you can set a time for hibernation, unfortunately.

Try:

ping -n 20 127.0.0.1 > NUL 2>&1 && shutdown /h /f

The ping is a hackish way of delaying the action. -n 20 should wait for 20 seconds.

(the double && will allow you to do a Ctrl+C to cancel the operation, but if you use a simple & then pressing Ctrl+C will only break the timer and then continue to shut down)"
Guest [Entry]

"I use the following:

sleep 20 && shutdown /h /f

Or this if I want it off at a certain time:

At 22:30 shutdown /h /f"
Guest [Entry]

"If you have cygwin it's very simple: sleep 45m && shutdown /h

You can instruct sleep in minutes, hours, seconds and even days. Check out this answer about sleep."
Guest [Entry]

Did you try the Windows Task Scheduler? If you have the script you can set it to run at a certain time - this should answer the time delay question.
Guest [Entry]

"i always use this:

shutdown -h"