How to Shut Down or Restart Another Computer Using CMD

Download ArticleDownload Article

If you need to reboot or shut down another Windows PC on your local network, you can easily do so from the command prompt. When shutting a computer down remotely, you can warn users prior to shutdown, and even display a personalized message that will appear on the screen. This How.com.vn article will teach you two simple ways to remotely restart or turn off a Windows PC using an administrator-level command prompt.

Shutting Down Someone's Computer

If you are a network administrator, you can shut down anyone's computer who is currently on your network using your administrator credentials in CMD. Type the target computer's name followed by one space and "/s" to shut it down.

Method 1
Method 1 of 4:

Using CMD

Download Article
  1. How.com.vn English: Step 1 Click the Start button icon.
    It's the button with the Windows icon in the lower-left corner.
  2. How.com.vn English: Step 2 Type cmd.
    This searches for the command prompt and displays it at the top of the Windows Start menu.
    Advertisement
  3. How.com.vn English: Step 3 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.com.vn English: Step 4 Click Run as administrator.
    This opens the Command Prompt with administrative privileges.
    • You must be signed into Windows using an administrative account in order to run the Command Prompt as an administrator.
  5. How.com.vn English: Step 5 Type shutdown in the Command Prompt.
    This is the first line to shut down a computer.
    • To see a complete list of shutdown commands, type shutdown /? in the Command Prompt.
  6. How.com.vn English: Step 6 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.com.vn English: Step 7 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.com.vn English: Step 8 Type /f.
    Type this one space after "/s" or "/r". This forces all programs to close on the remote computer.
    • 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.
    • 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.com.vn English: Step 9 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.com.vn English: Step 10 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.com.vn English: Step 11 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.com.vn English: Step 12 Press ↵ Enter.
    This executes the command. The entire command should look something similar to this: shutdown m\\workspace1 /r /f /c "This computer will restart in 60 seconds. Please save all work." /t 60.
    • 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.
    • 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.
    EXPERT TIP
    How.com.vn English: Luigi Oppido

    Luigi Oppido

    Computer & Tech Specialist
    Luigi Oppido is the Owner and Operator of Pleasure Point Computers in Santa Cruz, California. Luigi has over 25 years of experience in general computer repair, data recovery, virus removal, and upgrades. He is also the host of the Computer Man Show! broadcasted on KSQD covering central California for over two years.
    How.com.vn English: Luigi Oppido
    Luigi Oppido
    Computer & Tech Specialist

    Expert Warning: If you're shutting down a computer from the command prompt, the computer will probably close all of its processes before it shuts down. However, if you run a shutdown command from a PowerShell, it could supersede any other safeties and shut everything down immediately, which could cause you to lose data.

  13. Advertisement
Method 2
Method 2 of 4:

Using Remote Shutdown Dialog

Download Article
  1. How.com.vn English: Step 1 Click the Start button icon.
    It's the button with the Windows icon in the lower-left corner.
  2. How.com.vn English: Step 2 Type cmd.
    This searches for the command prompt and displays it at the top of the Windows Start menu.
  3. How.com.vn English: Step 3 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.com.vn English: Step 4 Click Run as administrator.
    This opens the Command Prompt with administrative privileges.
    • You must be signed into Windows using an administrative account in order to run the Command Prompt as an administrator.
  5. How.com.vn English: Step 5 Type shutdown -i and press ↵ Enter.
    This opens the Remote Shutdown Dialog window.
  6. How.com.vn English: Step 6 Click Add.
    It's to the right of the "Computers" box.
  7. How.com.vn English: Step 7 Type the IP...
    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.
  8. How.com.vn English: Step 8 Choose if you...
    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. Step 9 Click the checkbox icon next to "Warn users of action" (Optional).
    This allows you to set a timer for when the computer(s) will shutdown.
  10. How.com.vn English: Step 10 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. Step 11 Click the checkbox icon next to "Planned" (Optional).
    This allows you to create an event tracker for the remote shutdown or restart.
  12. How.com.vn English: Step 12 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.com.vn English: Step 13 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.com.vn English: Step 14 Click Ok.
    This executes the Shutdown or Restart.
    • 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.
    • 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.
  15. Advertisement
Method 3
Method 3 of 4:

Enabling Printer and File Sharing

Download Article
  1. How.com.vn English: Step 1 Open the Control Panel.
    Use the following steps to open the Control Panel.
    • Click the Windows Start menu.
    • Type Control Panel.
    • Click the Control Panel.
  2. How.com.vn English: Step 2 Click Network and Internet.
    It's the green text next to an icon that resembles two computer screens in front of a globe.
    • Skip to the next step if you don't see this option.
  3. How.com.vn English: Step 3 Click Network and Sharing Center.
    It's next to an icon that resembles four connected computers
  4. How.com.vn English: Step 4 Click Change advanced sharing settings.
    It's at the bottom of the sidebar to the left.
  5. How.com.vn English: Step 5 Click the circular button next to Turn on network discovery.
    This enables network discovery.
  6. How.com.vn English: Step 6 Click the radial button next to Turn on file and printer sharing.
    This enables file and printer sharing.
  7. How.com.vn English: Step 7 Click Save Changes.
    It's in the lower-right corner.
  8. How.com.vn English: Step 8 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.com.vn English: Step 9 Click System and Security.
    It's in the sidebar menu to the left.
  10. How.com.vn English: Step 10 Click Allow an app through Windows Firewall.
    It's the second option below "Windows Defender Firewall".
  11. Step 11 Click the checkbox icon next to "File and Printer Sharing".
    It's in the list of allowed apps and features.
  12. Step 12 Click the checkbox icon below "Private".
    It's to the right of "File and Printer Sharing" in the list of allowed apps and features.
  13. How.com.vn English: Step 13 Click Ok.
    It's at the bottom of the Control Panel window. This saves and applies the changes you have made.
  14. Advertisement
Method 4
Method 4 of 4:

Editing the Registry

Download Article
  1. How.com.vn English: Step 1 Click the Start button icon.
    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.com.vn English: Step 2 Type regedit.
    This displays the regedit (Registry Editor) app.
    • Warning: Editing or deleting items in the Registry Editor can cause permanent damage to your operating system. Proceed at your own risk!
  3. How.com.vn English: Step 3 Click Regedit.
    This opens the Registry Editor app.
  4. Step 4 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":
    • Double-click the HKEY_LOCAL_MACHINE folder.
    • Double-click the SOFTWARE folder.
    • Double-click the Microsoft folder.
    • Double-click the Windows folder.
    • Double-click the CurrentVersion folder.
    • Double-click the Policies folder.
    • Double-click the System folder.
  5. How.com.vn English: Step 5 Create a new DWORD value.
    Use the following steps to create a new DWORD value in the "System" folder.
    • Right-click a black spot in the window to the right of the folders in the sidebar.
    • Hover over New.
    • Click DWORD (32-bit) Value.
  6. Step 6 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.com.vn English: Step 7 Right-click LocalAccountTokenFilterPolicy.
    This displays a menu to the right of the value.
  8. How.com.vn English: Step 8 Click Modify.
    This opens an editor window for the DWORD value.
  9. Step 9 Change the value data to "1".
    Use the box below "value data" to change the value from "0" to "1".
  10. How.com.vn English: Step 10 Click Ok.
    This saves the DWORD value. You can now close the registry editor.[1]
  11. Advertisement

Community Q&A

Search
Add New Question
  • Question
    How do I shut down or restart another computer using CMD if the PC has no name?
    How.com.vn English: Community Answer
    Community Answer
    Type in the IP address instead of the name.
  • Question
    I want to unlock my phone. Is it possible using the above procedure?
    How.com.vn English: XXWolfBane YT
    XXWolfBane YT
    Community Answer
    It is not possible to unlock your phone with the procedure above.
  • Question
    Can I use -s to cancel a shutdown in CMD?
    How.com.vn English: Community Answer
    Community Answer
    No, instead of -s, try using the command "shutdown -a" (without the quotation marks). This will cancel your shutdown.
See more answers
Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit
      Advertisement

      Video

      Tips

      Submit a Tip
      All tip submissions are carefully reviewed before being published
      Thanks for submitting a tip for review!
      Advertisement

      Warnings

      • It is only for educational purposes only; don't misuse it.
      • Be very careful when editing the registry. If you make a mistake when doing so, then you may have to reinstall Windows to fix it.
      Advertisement

      About This Article

      How.com.vn English: Luigi Oppido
      Co-authored by:
      Computer & Tech Specialist
      This article was co-authored by Luigi Oppido and by How.com.vn staff writer, Travis Boylls. Luigi Oppido is the Owner and Operator of Pleasure Point Computers in Santa Cruz, California. Luigi has over 25 years of experience in general computer repair, data recovery, virus removal, and upgrades. He is also the host of the Computer Man Show! broadcasted on KSQD covering central California for over two years. This article has been viewed 604,805 times.
      How helpful is this?
      Co-authors: 21
      Updated: May 8, 2024
      Views: 604,805
      Article SummaryX

      1. Open the Windows Start menu.
      2. Type CMD
      . 3. Double-click the Command Prompt.
      4. Type shutdown.
      5. Type \\ followed by the name of the target computer.
      6. Type /s to shutdown or /r to restart.
      7. Type /f.
      8. Type /c.
      9. Type a shutdown alert message in quotation marks.
      10. Type /t.
      11. Type the number of seconds until the shut down or restart happens.
      12. Press the Enter key.

      Did this summary help you?

      Thanks to all authors for creating a page that has been read 604,805 times.

      Is this article up to date?

      ⚠️ Disclaimer:

      Content from Wiki How English language website. Text is available under the Creative Commons Attribution-Share Alike License; additional terms may apply.
      Wiki How does not encourage the violation of any laws, and cannot be responsible for any violations of such laws, should you link to this domain, or use, reproduce, or republish the information contained herein.

      Notices:
      • - A few of these subjects are frequently censored by educational, governmental, corporate, parental and other filtering schemes.
      • - Some articles may contain names, images, artworks or descriptions of events that some cultures restrict access to
      • - Please note: Wiki How does not give you opinion about the law, or advice about medical. If you need specific advice (for example, medical, legal, financial or risk management), please seek a professional who is licensed or knowledgeable in that area.
      • - Readers should not judge the importance of topics based on their coverage on Wiki How, nor think a topic is important just because it is the subject of a Wiki article.

      Advertisement