How to enable Remote Desktop using Command Prompt on Windows 10

You can quickly enable or disable Remote Desktop and configure the firewall ports on Windows 10 using the command-line, and here's how.

Windows 10 Remote Desktop enabled
Windows 10 Remote Desktop enabled
  • 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.

On Windows 10, you can use the Remote Desktop feature to remotely access a computer or server to help other users or manage services without being physically present at the location.

Although you can manage the feature through the Settings app, you can also turn Remote Desktop on or off on Windows 10 using commands with Command Prompt or PowerShell. You may want to use this method to create a script to configure Remote Desktop on multiple computers more quickly. Or you can send the script to a user, allowing them to set up the feature without additional steps automatically.

This guide will teach you 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.

Important: Remote Desktop is not a feature available on Windows 10 Home. It is only on Windows 10 Pro, Enterprise, and Education. It is also recommended you create a full backup of your computer before proceeding, as modifying the registry can cause irreversible damage to your system.

Enable Remote Desktop from Command Prompt

To enable the remote desktop protocol with Command Prompt, use these steps:

  1. Open Start on Windows 10.

  2. Search for Command Prompt, right-click the top result, and select the Run as administrator option.

  3. 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

    Remote Desktop enable command

  4. (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 enable 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, use these steps:

  1. Open Start.

  2. Search for Command Prompt, right-click the top result, and select the Run as administrator option.

  3. 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

    Remote Desktop disable command

  4. (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.

About the author

Mauro Huculak is a Windows How-To Expert who started Pureinfotech in 2010 as an independent online publication. He has also been a Windows Central contributor for nearly a decade. Mauro has over 14 years of experience writing comprehensive guides and creating professional videos about Windows and software, including Android and Linux. Before becoming a technology writer, he was an IT administrator for seven years. In total, Mauro has over 20 years of combined experience in technology. Throughout his career, he achieved different professional certifications from Microsoft (MSCA), Cisco (CCNP), VMware (VCP), and CompTIA (A+ and Network+), and he has been recognized as a Microsoft MVP for many years. You can follow him on X (Twitter), YouTube, LinkedIn and About.me. Email him at [email protected].