On TV.com: THE GIRLS NEXT DOOR photos

Servers and Storage

Host: John Sheesley
Contact

The Windows Server 2003 computer you are working on will not shut down. You don’t have any luck using the Start menu or the [Ctrl][Alt][Delete] methods, and you need to restart the server as quickly as possible. There is a quick workaround that gets the job done — and you don’t even have to handle power cords or the power switch.

From the command line, you can shut down or reboot any Windows Server 2003 computer (or even Windows XP or Vista machines) with the Shutdown.exe command. (Note: The exe file extension is optional for the Shutdown command.) Shutdown.exe contains a number of switches that allow you to specify different actions for the server when the Shutdown command executes. The Shutdown.exe switches are as follows:

/? Displays the Help listing
/i Displays the graphical user interface (GUI); it must be the first option
/l Logs off the current user; it cannot be used with the /d or /m options
/s Shuts down the computer
/r Shuts down and restarts the computer
/g Shuts down and restarts the computer and then restarts any registered applications
/a Aborts system Shutdown
/p Turns off the local computer with no timeout or warning
/h Hibernates the local machine
/e Documents the reason for shutting down the computer
/m Specifies the target computer; it is used with \\computername
/t xxx Where xxx is the number of seconds before Shutdown
/c “comment” Where “comment” is the reason for the Shutdown or restart
/f Forces running applications to close without warning users
/d [p|u:]xx:yy Provides the reason for the Shutdown action: p = planned; u= unplanned; xx supplies the major reason code; yy = supplies the minor reason code

When you enter a Shutdown with no arguments, the Help listing will display. The Help listing also includes the reason codes available for use with the /d switch. The reason codes are shown below:

Reasons on this computer:
E=Expected U=Unexpected P=Planned c=Customer Defined
Type Major Minor Title

 

 

 

 

U

0

0

Other(Unplanned)
E

0

0

Other(Unplanned)
EP

0

0

Other(Planned)
U

0

5

Other Failure: System Unresponsive
E

1

1

Hardware: Maintenance(Unplanned)
EP

1

1

Hardware: Maintenance(Planned)
E

1

2

Hardware: Installation(Unplanned)
EP

1

2

Hardware: Installation(Planned)
P

2

3

Operating System: Upgrade (Planned)
E

2

4

Operating System:
Reconfiguration (Unplanned)
EP

2

4

Operating System:
Reconfiguration(Planned)
P

2

16

Operating System:
Service Pack (Planned)
U

2

17

Operating System:
Hotfix (Unplanned)
P

2

17

Operating System:
Hotfix(Planned)
U

2

18

Operating System:
Security Fix(Unplanned)
P

2

18

Operating System:
Security Fix(Planned)
E

4

1

Application: Maintenance(Unplanned)
EP

4

1

Application: Maintenance(Planned)
EP

4

2

Application: Installation(Planned)
E

4

5

Application: Unresponsive
E

4

6

Application: Unstable
U

5

15

System Failure: Stop Error
E

5

19

Security Issue
U

5

19

Security Issue
EP

5

19

Security Issue
E

5

20

Loss of Network Connectivity
(Unplanned)
U

6

11

Power Failure: Cord Unplugged
U

6

12

Power Failure: Environment
P

7

0

Legacy API Shutdown

You can use many of these switches in conjunction with one another when issuing the Shutdown command. A usage example for the Shutdown command follows:

Shutdown /r /c “Hanging Application or service” /t 30

This example would restart the local machine storing the comment provided with the /c switch. Windows would wait 30 seconds before initiating the restart. You might also create a batch file to use when it is necessary to restart a server in a remote location. The batch file might look like this:

Shutdown /m \\computername /r /c “Remote Restart” /t 45

By saving this command in a batch file, it can save you time if you routinely restart the same remote server.

Miss a Windows Server 2003 tip?

Check out the Windows Server 2003 archive to get even more Windows Server 2003 tips.

Stay on top of the latest Windows Server 2003 tips and tricks with our free Windows Server newsletter, delivered each Wednesday. Automatically sign up today!

Print/View all Posts Comments on this blog

Nice tiphanoch@...  | 01/16/08
Overall not a bad summryDumphrey  | 01/16/08
DC ::: shutdown -i restartMaster G  | 01/16/08
Need to use FQDNRoyB@...  | 01/16/08
Keep in mindbjones@...  | 01/16/08
RE: Restart Windows Server 2003 from the command lineJustin James  | 01/16/08
RE: Restart Windows Server 2003 from the command linegary_horne@...  | 01/16/08
Create a Batch file!!!asmit21  | 01/16/08
...Or create Scheduled Task to reboot weeklyitadmin01  | 01/18/08
RE: Restart Windows Server 2003 from the command lineduke.url@...  | 01/16/08
RE: Restart Windows Server 2003 from the command linejleather  | 01/16/08
thnxdenialjohn2007@...  | 02/13/08
Windows 98 had a better way of doing this.Photogenic Memory  | 01/16/08
Not newtundraroamer  | 01/16/08
... but nice to have it laid out in a table like thisOregonLighthouse  | 01/17/08
RE: Restart Windows Server 2003 from the command linegregberry@...  | 01/16/08
All Windows OS's are the same in this, I think?asmit21  | 01/17/08
RE: Restart Windows Server 2003 from the command linehay.willemsen@...  | 01/16/08
RE: Restart Windows Server 2003 from the command lineJustFishin  | 01/16/08
RE: Restart Windows Server 2003 from the command linebriansa@...  | 01/16/08
Print-Friendly version of this page not workingOregonLighthouse  | 01/17/08
Another handy use for Shutdown...OregonLighthouse  | 01/17/08
RE: Restart Windows Server 2003 from the command linedtrivison@...  | 02/14/08
how to retart serverkmmohd_anwar@...  | 06/02/08
Command neededJustin James  | 06/02/08

What do you think?

Trackbacks

The URI to TrackBack this entry is: http://blogs.techrepublic.com.com/datacenter/wp-trackback.php?p=245

  • Restart Windows Server 2003 from the command line

    When the Windows Server 2003 computer you are working on will not shut down and you don’t have any luck using the Start menu or the [Ctrl][Alt][Delete] methods — and you need to restart the server as quickly as possible — Derek …

    Trackback by NETWORK TEKS' COMPUTER NEWS BLOG @ 8:00 pm January 15, 2008

  • Computer Problems Solutions & Comedy

    Restart Windows Server 2003 from the command line http://blogs.techrepublic.com.com/datacenter/?p=245

    Trackback by Anonymous @ 3:29 am January 16, 2008

  • Restart Windows Server 2003 from the command line

    Restart Windows Server 2003 from the command line. http://blogs.techrepublic.com.com/datacenter/?p=245.

    Trackback by Computer Problems Solutions & Comedy @ 9:41 am January 16, 2008

  • Restart Windows Server 2003 from the command line

    Not a question, just something I thought some of you 2003 admins might like to know about. The Windows Server 2003 computer you are working on will not shut down. You don’t have any luck using the Start menu or the [Ctrl][Alt][Delete] …

    Trackback by Windows Central Forums @ 12:49 pm January 16, 2008

  • Restart Windows Server 2003 from the command line

    Nothing more than a nice reference article for all you server admins who would love a list on all the switches you can add to the shutdown.exe command when you need to remotely reboot a computer. The Windows Server 2003 computer you are …

    Trackback by Windows Central Forums @ 12:51 pm January 16, 2008

Recent Entries

Archives

TechRepublic Blogs



Troubleshooting PC Hardware
Your organization can't put business productivity on hold while you research users' hardware problems. This guide will quickly get you up to speed on ...
Buy Now
Windows XP vs. Mac OS X
This presentation, entitled Standardizing on Windows XP Instead of MAC OS X, provides a pre-packaged option for defending Windows XP against MAC OS X. ...
Buy Now
advertisement
Click Here