Skip to Content

How Do You Shutdown or Restart a Remote Computer Using Command?

To restart or shut down a Windows computer remotely, you can use the shutdown.exe command. Here’s a straightforward breakdown of the process, with solutions for common issues.

Basic Command for Remote Shutdown or Restart

Command:

shutdown /r /t 120 /m \\192.168.1.210
  • /r – Restarts the remote computer.
  • /t 120 – Sets a 120-second delay before shutdown.
  • /m \\192.168.1.210 – Specifies the remote computer’s network address.

Note: Ensure that your account has admin rights on the remote machine.

How to Solve “Access Denied (5)” Error

If the “Access Denied” error appears, you may need to enable remote access to the computer’s admin shares.

Step 1: Allow Remote Access to Admin Shares

Use this command to modify a system registry setting that enables remote access:

reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v "LocalAccountTokenFilterPolicy" /t REG_DWORD /d 1 /f

Step 2: Enable Inbound Firewall Rules for WMI and SMB

Adjust Windows Defender Firewall settings to allow communication:

PowerShell Command:

Get-NetFirewallrule -name WMI-RPCSS-In-TCP,WMI-WINMGMT-In-TCP,FPS-SMB-In-TCP | Enable-NetFirewallRule

Alternative: Configure these rules via Group Policy (GPO) if managing multiple devices.

Command with Credentials

To authenticate on the remote computer with specific credentials:

Step 1: Map Network Drive with Credentials

net use \\192.168.13.111 /u:corp\username

Step 2: Execute Shutdown Command

shutdown /s /t 60 /f /m \\192.168.13.111

Restart Multiple Computers Remotely

To restart multiple computers, use a text file with their IP addresses and a PowerShell script:

Step 1: Prepare a Computer List

Save computer names or IP addresses in a file like C:\PS\PC-list.txt.

Step 2: Execute PowerShell Script

$sh_msg = "Your computer will be automatically restarted in 10 minutes. Save your files and close running apps"
$sh_delay = 600 # seconds
$computers = gc C:\PS\PC-list.txt
foreach ($comp in $computers) {
& 'C:\Windows\System32\SHUTDOWN.exe' "-m \\$comp -r -c $sh_msg -t $sh_delay"
}

Using the Remote Shutdown GUI

For users who prefer a graphical interface:

Access GUI

shutdown /i

Using the Remote Shutdown GUI

Features:

  • Add multiple computers.
  • Customize notification messages.
  • Record the shutdown reason in the Windows event log.

These commands and configurations make it simple to manage remote Windows machines, even in bulk.