Playing with System Shutdown







Windows

To shutdown a windows box (remember we aren’t talking pre XP machines) the command line option is “shutdown”

C:\> shutdown /?

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 option
-l      Log off (cannot be used with -m option)
-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)

To simply shutdown a machine

C:\> shutdown -s -t 30

-s = shutdown
-t = time to wait
30 = seconds

This command will shutdown the machine in 30 seconds.  The system will show a warning message like the figure blow.

C:\> shutdown -s -t 30 –c “This is a shutdown initiated from Command Line”

To Show a message in the dialog box  you  can go ahead with where -c = comments

To restart the machine

C:\> shutdown -r -t 30

To log off a machine

C:\> shutdown -l -t 30

But most importantly to ABORT a shutdown in progress use
   
C:\> shutdown –a

-a = abort
-a switch doesn’t require any more parameter. But remember shutdown –a has to run before lsass.exe or services.exe is terminated.

Pankit Thakkar
pankit@chmag.in

Linux

This time the command in Linux is very much similar to Windows.
To shutdown instantaneously
        
# shutdown

To reboot in 1 min

 # shutdown -r +1

To abort the shutdown

 # shutdown -c          

To reboot at a specific time

# shutdown -r 16:30    

Shutdown and reboot at 4:30pm

Comments

ha ha very true ... tell me

ha ha very true ... tell me what is there to learn from this ... this is so basic stuff ... please write something for grown ups

What bullshit ?

you just wasted 2 min of my life in reading your bullshit article...
give me backkk my 2 min.....

adrenaline boost

This article kicks ass. You guys just gave me the happiest moment of my day. I bow to the author. And to the editors, I bow to your interest in original content even if it sucks.

This article is a complete

This article is a complete waste of time even students from Std V know all this.

First Hacking Magazine from

First Hacking Magazine from India - Bravo.
Check out the topics discussed 'HOW TO SHUTDOWN USING CMD.EXE' - Are you guys Ankit Fadia's Fan???