Computer shutdown (remote)

Shutdown Command Examples

To bring this all together, let’s go over a few examples. First, let’s say that you are connected to your office PC via Remote Desktop and you want to reboot it immediately. You know that no one else is using it and all of your documents and data are saved. While in the Remote Desktop session, launch Command Prompt on your office PC and type the following command:

shutdown -r -f -t 0


That command will reboot the computer (-r), force all applications to close so that one doesn’t get stuck and prevent the reboot from happening (-f), and it will happen immediately with a zero second delay (-t 0). In this case, we’re accessing the Command Prompt via Remote Desktop directly on the office PC, so we don’t need to specify the computer name with the -m parameter because we are, in effect, operating on the local machine, even though we’re not sitting in front of it.
 
command-prompt-shutdown
Here’s a second example: you work from home with your spouse, but have different offices in the house. In your office, you need to shut down your spouse’s computer (computer name “UPSTAIRS”) because a lightning storm is rolling in and you want to be on the safe side. You think your spouse isn’t currently using the computer, but you can’t be sure. Here’s a shutdown command that you could initiate on your own PC:

shutdown -s -f -m \\UPSTAIRS -t 60 -c "Shutting down for storm. Save work and close apps."

This command shuts down the computer (-s), forces running applications to close (-f), designates the remote PC by name (-m \\UPSTAIRS) because you’re executing the command on your own PC, gives a time delay of 60 seconds (-t 60), and provides a descriptive message (-c) that will appear on your spouse’s computer to notify them of the impending shutdown.
Now, before you start worrying about pranksters and hackers remotely shutting down your PC without authorization, note that you’ll need to have admin access to the target PC you’re trying to shut down. That is, in our example, you’ll need to have an admin account on the “UPSTAIRS” PC with the same name and password as the account you’re using on your own PC. Alternatively, in business environments, your Active Directory account will need to be authorized on both PCs.
There are many more parameters and options, including some logging and reporting options that are useful to IT administrators. To view them all, bring up the shutdown command’s help document by typing:

shutdown /?

While the intent of this article was to show you how to use the shutdown command to shut down or reboot remote PCs, you can always use any of the commands on your own local PC if you feel so inclined. So the next time you need to reboot, don’t head for the Start Menu or charms bar, get your geek on in the Command Prompt instead.