The Vista Shutdown Command Line Switches
Shutdown is an exciting command line program available in Vista and Windows 7. I say exciting both in the sense that everyone loves this command, and also exiting in the sense it has a dramatic effect – downs the computer. Therefore, take care when experimenting with this command.
Sooner or later you will shoot yourself in the foot, and accidentally shutdown your own machine instead of the computer that you really wish to reboot. So pay close attention to this abort syntax.
Shutdown /a /m \\computername
Windows Vista ‘Shutdown’ Topics
- Shutdown – The Basics
- Shutdown – Select your MainMachine
- Shutdown Command Line – Add the Extras
- Shutdown – Boring Box
- Windows 8 Shutdown Command
- PowerShell Shutdown Command
Shutdown – The Basics
Shutdown is a built-in executable in Vista, XP and the Windows Server family. Begin by clicking on the Start orb, type cmd in the ‘Search’ box. Your first major decision is do you want a simple shutdown or a restart? To stop the machine, use Shutdown /s. Alternatively, if you want the machine to reboot then type Shutdown /r.
After you issue the /s or /r, a dialog box appears with a 30 second count down, remember if you are just testing, then cancel. Watch out for the dialog box disappearing after you type the Shutdown /a instruction.
Shutdown – Select your MainMachine
For the ‘Remote’ switch /m. The full command would be:
Shutdown /r /m \\MainMachine. The slashes look slightly strange, but that’s how it works, in this example, ‘MainMachine’ is the name of the remote computer. None of these commands are case sensitive so sHUTDOWN /R /m \\MainMachine would work.
Note: There is no space between the backslashes and the computername
\\ MainMachine would be a mistake.
For the local machine, try 127.0.0.1
For example, shutdown /s /m \\127.0.0.1. Useful in batch files.
Examples of The Vista Shutdown switches
shutdown /s /m \\Laptop – Shuts down a remote machine called ‘Laptop’
shutdown /r /m \\BigServer – Reboots a remote machine called ‘BigServer. See More About Remote Restart in Windows Server 2008
Note: For once the sequence of switches is vital, hence shutdown /m /s \\ laptop does not work.
Shutdown Command Line – Add the Extras
/a abort or cancel. See more about Cancel Windows Shutdown
/i is for interactive. This shutdown switch provides a GUI so that you can make your choices more easily.
/t is for time. Is 30 seconds too short (or too long) a time? You can adjust with /t: 60 to display the dialog box for one minute. Maximum is 600 seconds.
/f is for force. ‘Mr Nasty’, is coming – ready or not! Shutdown /r /f as you may have guessed, restarts the machine, and closes any programs without warning.
/c is for a comment. Would you like to put your stamp on the shutdown? Let people know who is in charge, who is shutting them down? /c "Guy is shutting you down"
/d p:4:1 reason. Personally, I would avoid this switch, the syntax is tricky the numbers obscure and worst of all it does nothing exciting. That said the idea is sound, it enters a reason for the shutdown in the event log. If you activate shutdown’s help, then you will get a whole list of major and minor reasons that you could employ with this switch. For me, this switch is an option, an option that I do not take.
Note 1: Shutdown’s switches work equally well with a dash, for example, -d, -r or -a
(instead of /d, /r or /a)
Note 2: See Also:
- An example of Shutdown in Windows 7
- Windows 2003 remote shutdown commands
- Windows Server 2008 Remote Shutdown
Guy Recommends: SolarWinds Free Wake-On-LAN Utility
Encouraging computers to sleep when they’re not in use is a great idea – until you are away from your desk and need a file on that remote sleeping machine!
WOL also has business uses for example, rousing machines so that they can have update patches applied. My real reason for recommending you download this free tool is because it’s so much fun sending those ‘Magic Packets’. Give WOL a try – it’s free.
Download your free copy of SolarWinds Wake-On-LAN
Separate Problem Event Tracker
How to disable the annoying shutdown tracker.
Here are instructions to modify group policy to disable shutdown tracker.
Restart-Computer PowerShell Cmdlet
PowerShell v 2.0’s Restart-Computer cmdlet is very similar to Vista’s shutdown /r command. A likely scenario is that you wish to automate the reboot of a local or remote server. With a tiny substitution to the cmdlet’s verb you could change the command so that it simply shuts down the computer.
See more about using PowerShell’s restart-Computer instead of the Vista shutdown command line.
Guy Recommends: A Free Trial of the Network Performance Monitor (NPM) v11.5
SolarWinds’ Orion performance monitor will help you discover what’s happening on your network. This utility will also guide you through troubleshooting; the dashboard will indicate whether the root cause is a broken link, faulty equipment or resource overload.
What I like best is the way NPM suggests solutions to network problems. Its also has the ability to monitor the health of individual VMware virtual machines. If you are interested in troubleshooting, and creating network maps, then I recommend that you try NPM now.
Download a free trial of Solarwinds’ Network Performance Monitor
Summary of The Vista Shutdown Command Line
It’s fun to experiment with the shutdown command line switches, one day when you want restart a remote computer, shutdown /r will save you a long walk. My advice is to learn the /a (abort) switch, that way you won’t panic if you issue a command to shutdown the local laptop instead of the network machine.
If you like this page then please share it with your friends