COMPUTERS | There are many situations in which you might need to leave from the computer, but you can't shut it off yet, as something's keeping it busy. For instance, if Windows (or any other piece of software for that matter), decides to perform updates on the system, thus preventing you from logging off right away.

Maybe you're downloading a large file that would take a couple of hours before completing, or perhaps your antivirus programme decides to perform a full virus scan right when you were going to bed? Rather than cancelling your download or virus scan (or stay up all night waiting for them to finish), wouldn't you prefer giving the PC some time to finish whatever it's doing and then having it to automatically shut down? Well, you can, by telling the system to turn itself off, reboot, or just yourself log out after a given amount of time.

While there are softwares designed specifically for scheduling log-off and shutdown of the computer, they aren't always very reliable, and are certainly not always free either. And besides, why bloat your system with additional software, when this functionality already comes built into Windows?

Here's how you schedule a shutdown/reboot/log off in Windows:

All you need for this is your command prompt (DOS window):
  1. Hold the Windows key and press [R], and you will be prompted to specify a programme to run.
    Type cmd and hit [Enter].
    Alternatively, if you don't have a Windows key on your keyboard...
    In Windows 7 or Vista: open it by going to the Start menu and type cmd and hit [Enter] on your keyboard. If you're on Windows XP: first open the Start menu, then select "Run...", then type cmd followed by an [Enter] stroke.
  2. The command you'll need to use here is simply called shutdown. After typing that, you'll also need to supply an argument stating whether you want to just log off (-l), restart the computer (-r), or shut it down altogether (-s), followed by the time (-t) in which you want this to happen, designated in seconds.
    So, for instance, if you want the computer to shut itself down after one hour, just type the following into the command prompt:
    shutdown -s -t 3600
    Where 3600 means one hour, represented in seconds.
  3. Should you ever change your mind, you could always abort the countdown, by typing:
    shutdown -a

Complete syntax of the shutdown command

Usage:
shutdown [-i | -l | -s | -r | -a] [-f] [-m \\computername] [-t xx] [-c "comment"] [-d up:xx:yy]
(No args)Display this message (same as -?)
-i
Display GUI interface, must be the first argument. Ran from either the command line or from the Windows run line this option would open the remote shutdown dialog Window.
-l
Log off (cannot be used with -m argument)
-s
Shutdown the computer
-r
Shutdown and restart the computer
-a
Abort a system shutdown
-m \\computername
Remote computer to shutdown/restart/abort
-t xx
Set timeout for shutdown to xx seconds
-c "comment"
Shutdown comment (maximum of 127 characters)
-f
Forces running applications to close without warning
-d [u] [p]:xx:yy
The reason code for the shutdown
u is the user code
p is a planned shutdown code
xx is the major reason code (positive integer less than 256)
yy is the minor reason code (positive integer less than 65536)

Comment (-c) argument

shutdown -r -c "Rebooting for latest updates."
This would display a Windows System Shutdown window for 30 seconds, warning the user that the computer is going to shutdown and then restart the computer.


Hope you found this helpful! Good luck!
/theJo

Comment and rate this article on:
Delicious | digg | JotLinks | reddit