General Software and Sytem Fixes

Delayed Shutdown

Have you ever found yourself wanting to shut your Windows box down but it's in the middle of doing something? If you know roughly how long this something will take (say it's rendering some files at about 2 minutes each and there's only 10 frames left), you could either go away for 20 minutes and come back to turn your PC off, a bit of a pain if you were planning on going to bed, or you could do the smart thing, shutting down Windows from the command-line!

In Vista and Windows 7 click the start button and in the search bar (see Fig. 1) type:

shutdown /s /t XXXX.

Windows search bar with shutdown command-line command

Fig. 1

What this does is it launches the shutdown.exe process with the /s shutdown and the /t delayed flags where XXXX is the time in seconds. It's always a good idea to add a few minutes to the estimated time in case there's a slight error in the completion time estimated by yourself or the computer. In Windows XP you need to click the Run button and type the above code into the run popup. There is a similar technique in Linux but that's an article for another blog :P.

Common times I use are:

  • 900 - 15 minutes
  • 1200 - 20 minutes
  • 1800 - 30 minutes
  • 3600 - 1 hour
  • 10800 - 3 hours

Now, a word of warning. A few times I've done this and come back in the morning to find Windows waiting for me to confirm shutdown because a program or two has refused to accept the shutdown command but this is by far and away in the minority of cases and it's usually caused by one of a few programs everytime, if they're running but not necessary for the completion of the task you're waiting on you can always close them before you leave your PC to do its thing. If you find this happens a lot you can always add the /f flag which forces all programs to close and gives the user no warning that it's going to shutdown.

shutdown /s /f /t 3600

Finally, at any point in time (before the time-out period expires and Windows has initiated shudown) you can type in shutdown /a to abort the shutdown timer.

If you'd like to know what other functions you can perform with this rather useful command-line tool, such as hibernating and restarting on a timer, load the Command Prompt using cmd in the search bar (or run dialog on XP) then type shutdown /? to bring up a list of all the flags and parameters it can take.

I hope you find this as useful as I do on a regular basis.

If you liked this blog post, why not buy me a beverage?

Blog Appreciation: Usefulness
blog comments powered by Disqus