timeout /t 600 & shutdown /h
waits for 600 seconds and then puts the computer into hibernation.
Sometimes, it is desirable to be able to shut down your PC at a later time. For this task, there is the command line command shutdown
on MS Windows PCs. Shutdown has a lot of options and I don’t need most of them most of the time. You can see them by running shutdown /?
.
What I want is mostly to put the PC into hibernation in some time from now on. According to shutdown /?
, shutdown /h /t 600
should do the trick and put the computer into hibernation in 600 seconds from now. But it doesn’t. I don’t know why, but the switches /h
and /t
do not work together with the shutdown command. There are two simple workarounds. For Vista and later, you can chain a timeout and a shutdown command with the &
. So,
timeout /t 600 & shutdown /h
does what I want.
But on pre-Vista PCs, there is no timeout
command. There you can use 600 pings to localhost to wait 600 seconds:
ping /n 600 127.0.0.1 & shutdown /h
shutdown /s /t 600
shuts down the computer in 600 seconds from now. This one works like it should.