This article will show you how to use the Windows Remote Shutdown command tool to remotely shutdown or restart a local or networked computer. This can sometimes be very useful if you have multiple computers at home or on a network that need to be quickly shut down or rebooted.
You can even shutdown your computer remotely over the Internet, but first you will need to either connect the VPN to the network or to the target computer that you want to shutdown. I’m not going to cover VPN in this article, but if you want to do it, feel free to google it.
You can perform a remote shutdown from the command line using the shutdown command and its associated switches, from a remote shutdown dialog box, or from a batch file. In this article, I will go over all three methods.
Remote shutdown overview
For this to work, you need to complete a few steps, otherwise you will constantly receive an “Access Denied” error (5), and it will drive you crazy.
Step 1. First, to remotely shut down a computer on the network, you need to make sure that you have administrative access to the target computer. If you are on a home network, the best way to do this is to make sure that all computers are in the same workgroup and that everyone has at least one administrator account with the same username and password.
To do this, you do not need to use the built-in Administrator account on either computer, but the user account you use on both computers must be a member of the Administrators group on the local computer. If you go to the control panel and click on “User Accounts” and it says “Administrator” or “Local Administrator”, then everything is in order. Again, the user account names and password must match.
If you are working in a corporate environment with a domain, you probably want to log in with a domain administrator account. Using these credentials, you will be able to shut down any other computer on the network, even if they are logged in with different credentials.
Step 2. The second step is to turn on File and Printer Sharing and allow it through Windows Firewall. To do this, go to Control Panel and first click on Network and Sharing Center. Click the Change advanced sharing settings link in the left menu and select the radio buttons for Turn on network discovery and Turn on file and printer sharing.
Return to the main Control Panel window and click on Windows Firewall. On the left menu, click Allow a program or feature through Windows Firewall.
Make sure you only check the Home / Work (private) box and not for everyone. You don’t need to allow anything else through the firewall. You can read on other sites allowing WMI, remote shutdown, network discovery, etc., but I tested it without them and it works great.
Step 3: Finally, if you’re trying to remotely target a Windows Vista, Windows 7 or Windows 8 computer, you’ll need to modify the registry. If you don’t, it just won’t work. You will only receive an “Access Denied” message no matter what.
Open Registry Editor by going to Start and typing regedit. Now move on to the next key:
HKEY_LOCAL_MACHINE – SOFTWARE – Microsoft – Windows – Current version – Policies – System
Right-click System on the left and select New – DWORD (32-bit).
The new value will appear at the bottom of the right window and the text will be highlighted. Change the name to LocalAccountTokenFilterPolicy and press Enter. Now double click on it and change the value from 0 to 1.
Click OK and close the registry. You do not need to restart your computer as the changes will take effect immediately. This registry key is required because in Windows Vista and later, the Administrator account will lose its credentials when connected remotely. This will allow the account to retain administrative privileges.
You will also read on other sites how to start the remote registry service if it is not running and how to edit the local security policy by adding the Everyone group to the Force Shutdown from Remote System Policy Setting option. In my testing on Windows 7 and 8, there was no need to perform these tasks, and it is not necessary, because it opens your system to potential hackers.
Obviously, you also need to know the names of all other computers on the network. You can do this by going to Control Panel and clicking “System”.
Remote shutdown via command prompt
The shutdown command is most flexible when used from the command line, because you can add several switches to it that allow you to customize the behavior. Go to Start, then Run and type CMD. You can see the list of switches by typing shutdown /? in the command window.
You must use at least one radio button for the command to do anything. Usually you should enter shutdown / x / y / z, where x, y, z are the letters in the list above.
Here are a couple of the most common command and action switches:
/ s: shuts down the computer p >
/ r: em> Restarts the computer.
/ m \ computername : target remote computer to shutdown
< em> / f: Forcibly close programs immediately
/ t: Will wait a certain amount of time in seconds before shutting down or restarting
< p align = "left"> / a: aborts shutdown if you used the previous shutdown command with / t.
So, to remotely shutdown another computer on your network, you must enter the following commands into the command line:
shutdown / m \ computername / r / f
This command will reboot the computer named computername and forcibly close all running programs.
shutdown â€“m \ computername â€“S â€“f â€“c “Computer will restart, save all work.” â€“t 60
This command will shutdown the computer named computername , forcibly close all running programs, show the user a message and a countdown of 60 seconds before shutdown.
Remote shutdown via shutdown dialog
If you don’t like all of these switches, or the use of the command line in general, you can open the shutdown dialog. This is easy to do by simply using the / i switch for the shutdown command.
The Remote Shutdown dialog box appears as shown below.
Click the Add or Browse button to add computers to the list. Then you can run commands on an entire group of computers. If you click Add, you will need to enter the network name of the computer in the format \ computername or just computername, or it works.
Of course, you need to know the actual computer name, which, as I mentioned, can be determined above. So add as many computers as you like to the list and then set your options. You can shutdown, restart, or annotate unexpected shutdown.
You can also display a warning if you like, for any number of seconds of your choice, and you can enter a comment at the bottom to be displayed to users. That’s all!
Remote shutdown by batch file
Finally, you can create a batch file so that all of this can be done by simply running the file. In addition, you can schedule the batch file to run at specific intervals or during specific events using the Task Scheduler.
Just go to Notepad and enter the commands that you would enter at the command line:
Then just save the file with a .BAT extension by selecting All Files in the Save as Type field and adding .bat to the end of the file name.
This will reboot three computers on my home network. You can put as many commands as you like in the batch file, so feel free to experiment!
I’ve written an extensive post on how to use batch files on Windows, so read it if you’re not familiar with batch files or the task scheduler. Enjoy!