How to restart remote Desktop from another computer using command prompt

How to restart remote Desktop from another computer using command prompt

Too lazy to stand up and push the power button on the computer in the other room? Here’s your solution.

If you have multiple always-on Windows 10 PCs set up in your home in different rooms, it can be a chore to shut down or reboot each one. Instead of physically visiting each machine, you can remotely reboot or shut down each machine. This article takes a quick look at a couple of options.

Shut Down or Restart a Windows 10 PC Using Remote Desktop

The simplest way to shut down or reboot a remote Windows 10 computer is to connect via Remote Desktop Protocol (RDP) and then click Start > Restart or Shut Down.

How to restart remote Desktop from another computer using command prompt

You’ll need to be running Windows 10 Pro, Education, or Enterprise on each computer for this to work. If you have a mix of operating systems on your network, you can use TightVNC to remotely control a PC from Mac, Windows, or Linux.

Shut Down or Reboot a Networked Windows PC from the Command Line

As an alternative to VNC or RDP, you can shut down or restart a networked PC from the command line. Connect your Windows PCs to the same network, then follow the steps below.

Note: For this method, you need to tweak some registry settings. It’s a fairly simple change, but be aware that misconfiguring your registry can cause system instabilities, so follow the steps carefully.

  1. On the computer that you want to reboot or shut down remotely, press Windows key + R, type: regedit then hit Enter on your keyboard.
  2. Navigate to the following registry key Computer\HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System. If you are running Windows 10 1703 or later, you can quickly find registry keys by copying and pasting the registry path into the address bar and hit Enter.
  3. Right-click on the System folder, select New > DWORD (32-bit) Value.

    How to restart remote Desktop from another computer using command prompt

  4. Enter the following label: LocalAccountTokenFilterPolicy.

    How to restart remote Desktop from another computer using command prompt

  5. Double-click the value, then change the value to 1.

    How to restart remote Desktop from another computer using command prompt

  6. Exit the registry, then restart your computer to confirm changes. Now you are ready to restart or shut down remotely.
  7. Press Windows key + X, click Command Prompt (Admin).
  8. At the command prompt, log into the machine. Example: net use \\MachineNamethen hit Enter. Enter your username on the machine or Microsoft Account ID followed by your password.

    How to restart remote Desktop from another computer using command prompt

  9. At the command prompt, type shutdown -r -m \\MachineName -t -01 then hit Enter on your keyboard.

    How to restart remote Desktop from another computer using command prompt

    The remote computer should automatically shut down or restart depending on the switches you choose. Notice, the command is similar to performing it locally. You can always specify a longer period for your shutdown or restart. In my case, I chose one minute. If you want to ensure the machine shuts down or restarts, you can add the /f switch, example: shutdown /m \\ MachineName /r /f. This will close out all open applications running on the remote machine.

How to restart remote Desktop from another computer using command prompt

Tip: An even easier command to use is the shutdown\i command. This will bring up a graphical dialog that lets you select the remote computer or enter its name using the Add button. You can then specify whether you want to shut down or restart and even add a comment.

How to restart remote Desktop from another computer using command prompt

Automate Multiple Shutdown/Restart Using Batch File

Connecting remotely and shutting down a computer is fine as a one-off, but what if you want to shut down or reboot a computer at the same time every day? If you have to do this through the command line every time, it becomes a drag real quick. An easier option is to automate restarting or shutting down all your computers. Fire up Notepad, then enter the remote shutdown command with each computer’s network name on a new line.

Fire up Notepad, then enter the remote shutdown command with each computers network name on a new line. For example:

shutdown -r -m \\DELL-PC1 -t -01

shutdown -r -m \\SURFACEPRO -t -01

shutdown -r -m \\MachineName -t -01

You can modify the switches based on whether you want to restart (-r) or shutdown (-s). Proceed to save the file using the .bat extension on your desktop, for example, shutdownrestart.bat

That’s it! Once you’ve mastered remote shutdowns, be sure to check out our Wake on LAN article. Great for scenarios where you need to wake up a machine to access resources.

Drop a line in the comments and let us know how it goes. This took a bit of trial and error to work reliably, so I am interested in knowing if these instructions go smoothly.

How to restart remote Desktop from another computer using command prompt

How do I restart another computer through remote desktop?

From the remote computer's Start menu, select Run, and run a command line with optional switches to shut down the computer:.
To shut down, enter: shutdown..
To reboot, enter: shutdown –r..
To log off, enter: shutdown –l..

How do I remotely restart a Command Prompt?

using COMMAND Line.
Login with a full administrative account to another computer..
Open a Command Prompt (CMD) window..
Type the following command:.
Example 1: Restart a remote server..
Shutdown /m \\servername /r..
Example 2: Restart a remote server immediately..
Shutdown /r /m \\servername /t 0..

How do I force restart remotely?

Four ways to remotely reboot a Windows machine.
shutdown -r — reboots the system..
shutdown -m — specifies a remote computer to be shutdown/restarted/logged off (\computername).
shutdown -s — shuts the system down (and powers it off)..
shutdown -l — logs the current logged on user off the system..