How to Shut Down or Restart Another Computer Using CMD

Command Prompt is a feature of Windows that provides an entry point for typing MS‑DOS (Microsoft Disk Operating System) commands and other computer commands. You can use the Command Prompt to remotely shutdown or restart another computer. Y...
Method 1 of 4:

Using CMD

  1. How to Shut Down or Restart Another Computer Using CMD Picture 1How to Shut Down or Restart Another Computer Using CMD Picture 1
    Click the Start button
    How to Shut Down or Restart Another Computer Using CMD Picture 2How to Shut Down or Restart Another Computer Using CMD Picture 2
    . It's the button with the Windows icon in the lower-left corner.
  2. How to Shut Down or Restart Another Computer Using CMD Picture 3How to Shut Down or Restart Another Computer Using CMD Picture 3
    Type cmd. This searches for the command prompt and displays it at the top of the Windows Start menu.
  3. How to Shut Down or Restart Another Computer Using CMD Picture 4How to Shut Down or Restart Another Computer Using CMD Picture 4
    Right-click Command Prompt. It has an icon that resembles a black screen with a white prompt. Right-clicking this icon displays a menu to the right of the Command Prompt icon.
  4. How to Shut Down or Restart Another Computer Using CMD Picture 5How to Shut Down or Restart Another Computer Using CMD Picture 5
    Click Run as administrator. This opens the Command Prompt with administrative privileges.
    1. You must be signed in to Windows using an administrative account in order to run the Command Prompt as an administrator.
  5. How to Shut Down or Restart Another Computer Using CMD Picture 6How to Shut Down or Restart Another Computer Using CMD Picture 6
    Type shutdown in the Command Prompt. This is the first line to shut down a computer.
    1. To see a complete list of shutdown commands, type shutdown /? in the Command Prompt.
  6. How to Shut Down or Restart Another Computer Using CMD Picture 7How to Shut Down or Restart Another Computer Using CMD Picture 7
    Type m computername. Type this one space after "shutdown" on the same line. Replace "computername" with the actual name of the target computer.
  7. How to Shut Down or Restart Another Computer Using CMD Picture 8How to Shut Down or Restart Another Computer Using CMD Picture 8
    Type /s or /r one space after the computer name. If you want to shut down the target computer type "/s" one space after the computer name. To restart the computer, type "/r" one space after the computer name.
  8. How to Shut Down or Restart Another Computer Using CMD Picture 9How to Shut Down or Restart Another Computer Using CMD Picture 9
    Type /f. Type this one space after "/s" or "/r". This forces all programs to close on the remote computer.
    1. Note: The user may lose unsaved work if programs are forced to close without saving. Continue to the next step to learn how to alert the user and give them a few seconds to save their work before the computer or shuts down or restarts.
    2. The entire command so far should look something similar to this: shutdown workspace1 /r /f. Press Enter to restart the computer immediately. Continue to the next step to add a timer with a comment.
  9. How to Shut Down or Restart Another Computer Using CMD Picture 10How to Shut Down or Restart Another Computer Using CMD Picture 10
    Type /c. This goes one space after "/f" on the same line. This allows to you send a message to the target computer.
  10. How to Shut Down or Restart Another Computer Using CMD Picture 11How to Shut Down or Restart Another Computer Using CMD Picture 11
    Type a message in quotation marks. This goes one space after "/c". The message should alert the user of the remote computer that the computer will shutdown. For example, you could type "This computer will restart. Please save all work". Make sure the message is in quotation marks (" ") .
  11. How to Shut Down or Restart Another Computer Using CMD Picture 12How to Shut Down or Restart Another Computer Using CMD Picture 12
    Type /t followed by the number of seconds. This goes one space after the message in the previous step. This is how you can give the user a few seconds to save their work before the computer shuts down. For example, /t 60 would give the user sixty seconds to save their work before their computer shuts down or restarts.
  12. How to Shut Down or Restart Another Computer Using CMD Picture 13How to Shut Down or Restart Another Computer Using CMD Picture 13
    Press Enter. This executes the command. The entire command should look something similar to this: shutdown mworkspace1 /r /f /c "This computer will restart in 60 seconds. Please save all work." /t 60.
    1. If you receive a message that says Access Denied, make sure you are signed in to an administrative account and that you have administrative access to the target computer. See Method 3 to learn how to enable File and Printer Sharing on both computers and allow it through the Windows Firewall.
    2. If you are unable to connect to the registry on the target computer, see Method 4 to learn how to edit the registry on the target computer.
Method 2 of 4:

Using the Remote Shutdown Dialog

  1. How to Shut Down or Restart Another Computer Using CMD Picture 14How to Shut Down or Restart Another Computer Using CMD Picture 14
    Click the Start button
    How to Shut Down or Restart Another Computer Using CMD Picture 15How to Shut Down or Restart Another Computer Using CMD Picture 15
    . It's the button with the Windows icon in the lower-left corner.
  2. How to Shut Down or Restart Another Computer Using CMD Picture 16How to Shut Down or Restart Another Computer Using CMD Picture 16
    Type cmd. This searches for the command prompt and displays it at the top of the Windows Start menu.
  3. How to Shut Down or Restart Another Computer Using CMD Picture 17How to Shut Down or Restart Another Computer Using CMD Picture 17
    Right-click Command Prompt. It has an icon that resembles a black screen with a white prompt. Right-clicking this icon displays a menu to the right of the Command Prompt icon.
  4. How to Shut Down or Restart Another Computer Using CMD Picture 18How to Shut Down or Restart Another Computer Using CMD Picture 18
    Click Run as administrator. This opens the Command Prompt with administrative privileges.
    1. You must be signed in to Windows using an administrative account in order to run the Command Prompt as an administrator.
  5. How to Shut Down or Restart Another Computer Using CMD Picture 19How to Shut Down or Restart Another Computer Using CMD Picture 19
    Type shutdown -i and press Enter. This opens the Remote Shutdown Dialog window.
  6. How to Shut Down or Restart Another Computer Using CMD Picture 20How to Shut Down or Restart Another Computer Using CMD Picture 20
    Click Add. It's to the right of the "Computers" box.
  7. How to Shut Down or Restart Another Computer Using CMD Picture 21How to Shut Down or Restart Another Computer Using CMD Picture 21
    Type the IP address of the target computer(s) and click Ok. The target computer is the computer you want to shut down or restart. Type the IP address of that computer in the "Add Computers" window, and click Ok.
    1. If you are not sure what the Private IP address is for the target computer, you can find it using that computer.
  8. How to Shut Down or Restart Another Computer Using CMD Picture 22How to Shut Down or Restart Another Computer Using CMD Picture 22
    Choose if you want to shut down or restart a computer. Use the drop-down menu below "What do you want these computers to do" to select "Shutdown" or "Restart".
  9. How to Shut Down or Restart Another Computer Using CMD Picture 23How to Shut Down or Restart Another Computer Using CMD Picture 23
    Click the checkbox
    How to Shut Down or Restart Another Computer Using CMD Picture 24How to Shut Down or Restart Another Computer Using CMD Picture 24
    next to "Warn users of action" (Optional). This allows you to set a timer for when the computer(s) will shutdown.
  10. How to Shut Down or Restart Another Computer Using CMD Picture 25How to Shut Down or Restart Another Computer Using CMD Picture 25
    Type the number of seconds until the computer(s) shutdown (Optional). Type a number in the box in the sentence "Display warning for [ ] seconds". This sets a timer for when the computer(s) shutdown.
  11. How to Shut Down or Restart Another Computer Using CMD Picture 26How to Shut Down or Restart Another Computer Using CMD Picture 26
    Click the checkbox
    How to Shut Down or Restart Another Computer Using CMD Picture 27How to Shut Down or Restart Another Computer Using CMD Picture 27
    next to "Planned" (Optional). This allows you to create an event tracker for the remote shutdown or restart.
  12. How to Shut Down or Restart Another Computer Using CMD Picture 28How to Shut Down or Restart Another Computer Using CMD Picture 28
    Select a reason for the shutdown (Optional). Use the drop-down menu below "Options" to select the best reason for the shutdown/restart. For example, "Hardware: Maintenance (Planned)".
  13. How to Shut Down or Restart Another Computer Using CMD Picture 29How to Shut Down or Restart Another Computer Using CMD Picture 29
    Type a comment (Optional). This will be displayed on the target computer. For example, "This computer will shut down in 60 seconds. Please save all work."
  14. How to Shut Down or Restart Another Computer Using CMD Picture 30How to Shut Down or Restart Another Computer Using CMD Picture 30
    Click Ok. This executes the Shutdown or Restart.
    1. If you receive a message that says Access Denied, make sure you are signed in to an administrative account and that you have administrative access to the target computer. See Method 3 to learn how to enable File and Printer Sharing on both computers and allow it through the Windows Firewall.
    2. If you are unable to connect to the registry on the target computer, see Method 4 to learn how to edit the registry on the target computer.
Method 3 of 4:

Enabling Printer and File Sharing Through the Windows Firewall

  1. How to Shut Down or Restart Another Computer Using CMD Picture 31How to Shut Down or Restart Another Computer Using CMD Picture 31
    Open the Control Panel. Use the following steps to open the Control Panel.
    1. Click the Windows Start menu.
    2. Type Control Panel.
    3. Click the Control Panel.
  2. How to Shut Down or Restart Another Computer Using CMD Picture 32How to Shut Down or Restart Another Computer Using CMD Picture 32
    Click Network and Internet. It's the green text next to an icon that resembles two computer screens in front of a globe.
    1. Skip to the next step if you don't see this option,
  3. How to Shut Down or Restart Another Computer Using CMD Picture 33How to Shut Down or Restart Another Computer Using CMD Picture 33
    Click Network and Sharing Center. It's next to an icon that resembles four connected computers
  4. How to Shut Down or Restart Another Computer Using CMD Picture 34How to Shut Down or Restart Another Computer Using CMD Picture 34
    Click Change advanced sharing settings. It's at the bottom of the sidebar to the left.
  5. How to Shut Down or Restart Another Computer Using CMD Picture 35How to Shut Down or Restart Another Computer Using CMD Picture 35
    Click the circular button next to Turn on network discovery. This enables network discovery.
  6. How to Shut Down or Restart Another Computer Using CMD Picture 36How to Shut Down or Restart Another Computer Using CMD Picture 36
    Click the radial button next to Turn on file and printer sharing. This enables file and printer sharing.
  7. How to Shut Down or Restart Another Computer Using CMD Picture 37How to Shut Down or Restart Another Computer Using CMD Picture 37
    Click Save Changes. It's in the lower-right corner.
  8. How to Shut Down or Restart Another Computer Using CMD Picture 38How to Shut Down or Restart Another Computer Using CMD Picture 38
    Click Network and Internet. It's in the address bar at the top of the Control Panel. This returns to the Network and Internet menu of the Control Panel.
  9. How to Shut Down or Restart Another Computer Using CMD Picture 39How to Shut Down or Restart Another Computer Using CMD Picture 39
    Click System and Security. It's in the sidebar menu to the left.
  10. How to Shut Down or Restart Another Computer Using CMD Picture 40How to Shut Down or Restart Another Computer Using CMD Picture 40
    Click Allow an app through Windows Firewall. It's the second option below "Windows Defender Firewall".
  11. How to Shut Down or Restart Another Computer Using CMD Picture 41How to Shut Down or Restart Another Computer Using CMD Picture 41
    Click the checkbox
    How to Shut Down or Restart Another Computer Using CMD Picture 42How to Shut Down or Restart Another Computer Using CMD Picture 42
    next to "File and Printer Sharing". It's in the list of allowed apps and features.
  12. How to Shut Down or Restart Another Computer Using CMD Picture 43How to Shut Down or Restart Another Computer Using CMD Picture 43
    Click the checkbox
    How to Shut Down or Restart Another Computer Using CMD Picture 44How to Shut Down or Restart Another Computer Using CMD Picture 44
    below "Private". It's to the right of "File and Printer Sharing" in the list of allowed apps and features.
  13. How to Shut Down or Restart Another Computer Using CMD Picture 45How to Shut Down or Restart Another Computer Using CMD Picture 45
    Click Ok. It's at the bottom of the Control Panel window. This saves and applies the changes you have made.
Method 4 of 4:

Editing the Registry

  1. How to Shut Down or Restart Another Computer Using CMD Picture 46How to Shut Down or Restart Another Computer Using CMD Picture 46
    Click the Start button
    How to Shut Down or Restart Another Computer Using CMD Picture 47How to Shut Down or Restart Another Computer Using CMD Picture 47
    . It's the button with the Windows icon in the lower-left corner. On newer versions of Windows, administrative privileges are often stripped when trying to access a computer remotely. You can fix this by editing the registry.
  2. How to Shut Down or Restart Another Computer Using CMD Picture 48How to Shut Down or Restart Another Computer Using CMD Picture 48
    Type regedit. This displays the regedit (Registry Editor) app.
    1. Warning: Editing or deleting items in the Registry Editor can cause permanent damage to your operating system. Proceed at your own risk!
  3. How to Shut Down or Restart Another Computer Using CMD Picture 49How to Shut Down or Restart Another Computer Using CMD Picture 49
    Click Regedit. This opens the Registry Editor app.
  4. How to Shut Down or Restart Another Computer Using CMD Picture 50How to Shut Down or Restart Another Computer Using CMD Picture 50
    Navigate to the "System" folder in "Policies". You can use the folders in the sidebar to the left to navigate in the Registry editor. Use the following steps to navigate to the "System" folder in "Policies":
    1. Double-click the HKEY_LOCAL_MACHINE folder.
    2. Double-click the SOFTWARE folder.
    3. Double-click the Microsoft folder.
    4. Double-click the Windows folder.
    5. Double-click the CurrentVersion folder.
    6. Double-click the Policies folder.
    7. Double-click the System folder.
  5. How to Shut Down or Restart Another Computer Using CMD Picture 51How to Shut Down or Restart Another Computer Using CMD Picture 51
    Create a new DWORD value. Use the following steps to create a new DWORD value in the "System" folder.
    1. Right-click a black spot in the window to the right of the folders in the sidebar.
    2. Hover over New.
    3. Click DWORD (32-bit) Value.
  6. How to Shut Down or Restart Another Computer Using CMD Picture 52How to Shut Down or Restart Another Computer Using CMD Picture 52
    Name the new DWORD value "LocalAccountTokenFilterPolicy". When you create a new DWORD value, the name will be highlighted blue. Immediately type "LocalAccountTokenFilterPolicy" to rename the value.
  7. How to Shut Down or Restart Another Computer Using CMD Picture 53How to Shut Down or Restart Another Computer Using CMD Picture 53
    Right-click LocalAccountTokenFilterPolicy. This displays a menu to the right of the value.
  8. How to Shut Down or Restart Another Computer Using CMD Picture 54How to Shut Down or Restart Another Computer Using CMD Picture 54
    Click Modify. This opens an editor window for the DWORD value.
  9. How to Shut Down or Restart Another Computer Using CMD Picture 55How to Shut Down or Restart Another Computer Using CMD Picture 55
    Change the value data to "1". Use the box below "value data" to change the value from "0" to "1".
  10. How to Shut Down or Restart Another Computer Using CMD Picture 56How to Shut Down or Restart Another Computer Using CMD Picture 56
    Click Ok. This saves the DWORD value. You can now close the registry editor.[1]
4 ★ | 272 Vote