sodcalculator

10 Tech How-To

How to Remotely Shutdown or Restart a Windows PC

Guide 10-13261 · Updated · Step by step

This guide shows you how to shut down or restart a Windows computer from another device on the same network, or even over the internet. You’ll learn the built-in Windows tools and the exact steps to set them up, plus what to do when the remote command fails.

What You’ll Need

  • A Windows PC you want to control (the target). It must be running Windows 10 or 11 Pro, Enterprise, or Education (the feature is not available on Windows Home).
  • Another device (Windows, Mac, Linux, or even a smartphone) to send the command.
  • Both devices connected to the same local network (Wi-Fi or Ethernet) for the basic method.
  • For remote access over the internet, you’ll need to set up port forwarding on your router or use a VPN.

Step-by-Step

  1. Enable Remote Shutdown on the target PC. Press Win + R, type regedit, and press Enter. Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System. Right-click in the right pane, select New → DWORD (32-bit) Value, name it LocalAccountTokenFilterPolicy, and set its value to 1. This allows remote UAC (User Account Control) to work for admin accounts.
  2. Open the Windows Firewall for Remote Shutdown. Press Win + R, type wf.msc, and press Enter. Click Inbound Rules in the left pane. Scroll down and find Windows Management Instrumentation (WMI) rules. There are usually four: two for “WMI� and two for “WMI (Async)�. Right-click each and select Enable Rule. If you’re on a private network, you may need to right-click and choose Properties, then on the Scope tab, ensure the remote IP addresses are allowed.
  3. Find the target PC’s IP address or hostname. On the target PC, open Command Prompt and type ipconfig. Look for the IPv4 address under your active network adapter (e.g., 192.168.1.10). Alternatively, use the computer name (right-click This PC → Properties → About).
  4. Send the shutdown command from the other device. Open Command Prompt on the controlling device. Use the following syntax:
    shutdown /s /m \\192.168.1.10 /t 0
    Replace the IP with your target’s address. For a restart, use /r instead of /s. The /t 0 means no delay; you can change the number to delay in seconds.
  5. Enter credentials when prompted. You’ll be asked for a username and password. Use an administrator account on the target PC. If you’re using a Microsoft account, use the email and password. If it’s a local account, use the local username.
  6. For remote access over the internet (optional). If you need to shut down from outside your home network, you’ll need to either set up port forwarding for port 135 (RPC) and 445 (SMB) on your router, or better, set up a VPN to connect securely to your home network first. Then use the same command as above but with your public IP address. Note: this is risky if not done carefully, so a VPN is strongly recommended.

Common Mistakes

  • Using Windows Home: Remote shutdown via the built-in command requires Pro or Enterprise. Home editions lack the necessary WMI permissions.
  • Forgetting to enable the registry key: Without LocalAccountTokenFilterPolicy, the target PC will reject the command with “Access is denied (5)� even if you have admin rights.
  • Firewall blocks: If the WMI rules are disabled or the firewall is set to block all incoming connections, the command will time out.
  • Wrong IP address: Using a stale IP (e.g., from a previous DHCP lease) will fail. Always verify the current IP.
  • Using a local account without a password: Windows will not allow remote shutdown with an empty password. Set a password on the target PC’s account.

Tips

  • Use shutdown /a to abort a shutdown that you’ve scheduled with a delay (e.g., /t 60). This works on the target PC itself, or remotely if you have the same permissions.
  • You can combine parameters: shutdown /r /m \\192.168.1.10 /t 30 /c "Restarting for updates" adds a comment that appears on the target screen.
  • For frequent use, create a shortcut on your desktop with the command, or use PowerShell with the Stop-Computer cmdlet.
  • If you’re on a domain network, you can use shutdown /i to open a graphical dialog that lets you browse for computers.

Troubleshooting

  • Error “Access is denied (5)�: This is the most common. Double-check the registry key from step 1. Also ensure the account you’re using is an administrator on the target PC. If you’re using a Microsoft account, try using the local account name (e.g., .\.\username).
  • Error “The network path was not found�: This usually means the target PC is not reachable. Try pinging the IP from the controlling device: ping 192.168.1.10. If ping fails, check that both devices are on the same network and that the target’s firewall isn’t blocking ICMP (though that’s separate from WMI).
  • Command hangs or times out: The firewall might be blocking the RPC ports. Re-enable the WMI inbound rules. Also ensure the target PC is not in sleep mode; remote shutdown won’t wake it. You can set the power plan to never sleep, or use Wake-on-LAN first.
  • Works locally but not remotely: If you can shut down the PC from the same machine but not from another, the issue is almost always firewall or credentials. Check the Windows Defender Firewall settings for the “Windows Management Instrumentation (WMI)� rules and ensure they are enabled for the network profile you’re using (Private vs. Public).

Frequently Asked Questions

Can I remotely shut down a Windows Home PC?

Not with the built-in shutdown command. Windows Home doesn’t support the WMI permissions needed. You can use third-party tools like TeamViewer or AnyDesk, which work on Home, but they require installing software on both ends.

Is there a way to do this without entering credentials every time?

Yes, you can use PowerShell to create a scheduled task with stored credentials, but that’s complex. Alternatively, you can use the shutdown command with the /d flag and a saved credential via cmdkey, but it’s not recommended for security reasons.

Can I shut down a remote PC that is in sleep mode?

No. The remote shutdown command only works if the PC is fully awake. You would need to enable Wake-on-LAN and send a magic packet first to wake it, then send the shutdown command.

What if I’m not on the same network?

You need to access the target PC over the internet. The safest way is to set up a VPN server on your home network and connect to it from your remote device. Then you can use the same shutdown command as if you were on the same LAN.

Can I use the same command to restart a PC?

Yes, just replace /s with /r. For example: shutdown /r /m \\192.168.1.10 /t 0.

Will this work if the target PC has a different Windows version than mine?

Yes, as long as the target is Windows 10/11 Pro or higher, the command works from any Windows version (including Home) on the controlling side. It also works from non-Windows devices that have an SSH client, but you’d need to use a different command syntax.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →