
- To enable Remote Desktop on Windows 10, open Command Prompt (admin) and run the “reg add “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server” /v fDenyTSConnections /t REG_DWORD /d 0 /f” and “netsh advfirewall firewall set rule group=”remote desktop” new enable=Yes” commands.
UPDATED 7/30/2025: On Windows 10, you can enable Remote Desktop to remotely access a device to provide support or manage a system without being physically present.
While the feature is available through the Settings app, you can also turn Remote Desktop on or off using Command Prompt or PowerShell. This method is useful for scripting deployments across multiple devices or sending a quick setup script to another user.
In this guide, I’ll outline the steps to use Command Prompt to enable or disable Remote Desktop and open the required firewall ports for a successful connection on Windows 10. (These instructions should also work on Windows 11.)
Enable Remote Desktop from Command Prompt
To enable the Remote Desktop Protocol with Command Prompt, follow these steps:
-
Open Start on Windows 10.
-
Search for Command Prompt, right-click the top result, and select the Run as administrator option.
-
Type the following command to enable the Remote Desktop Protocol and press Enter:
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f
-
(Optional) Type the following command to enable remote desktop through the Windows Firewall and press Enter:
netsh advfirewall firewall set rule group="remote desktop" new enable=Yes
Once you complete the steps, the protocol will be enabled on Windows 10, and you will be able to access the device remotely.
Disable Remote Desktop from Command Prompt
To turn off the Remote Desktop Protocol with Command Prompt, follow these steps:
-
Open Start.
-
Search for Command Prompt, right-click the top result, and select the Run as administrator option.
-
Type the following command to disable the Remote Desktop Protocol and press Enter:
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 1 /f
-
(Optional) Type the following command to disable Remote Desktop through the Windows Firewall and press Enter:
netsh advfirewall firewall set rule group="remote desktop" new enable=No
After you complete the steps, the Remote Desktop service will be turned off, and the Windows Firewall port will be closed.
This guide focuses on Command Prompt, but you can use the same commands to manage the Remote Desktop Protocol using PowerShell. However, you can always use PowerShell-specific commands to manage RDP on your computer.