How to Enable Remote Desktop using Command Tools

Remote Desktop is a great tool on Windows 11/10 that lets you operate your personal computer remotely on a different computer. With this tool enabled, you can access all your files and edit or modify them directly using a distant PC. This article presents two different command tools that let you enable remote desktop and they are Command Prompt and PowerShell. 

Enable Remote Desktop using Command Tools

If you are not comfortable with running codes, you may read this guide on how to enable and set up Remote Desktop via Settings on Windows PC. The Settings method works equally well, however, it involves more steps and thus you might find this guide useful to enable the Remote desktop by running 1-2 codes. 

Fix – Missing Taskbar on a remote desktop in Windows 10

Enable Remote Desktop using Command Prompt

To enable Remote Desktop on your Windows PC using Command Prompt, use these steps –

  • Press Windows + S, and start typing CMD in the search field. 
  • Right-click on the top result and select Run as administrator.
  • The UAC window might prompt next, hit Yes to authorize accessing the Command prompt as an admin. 
  • On the elevated console, copy/paste the below code, and press Enter

reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f

  • The above command will add a new entry inside the registry that works to enable Remote desktop connection on Windows. 
  • Even though you have enabled the Remote desktop, you might not still be accessing the Remote Desktop. This is because Windows Firewall is blocking this request of yours. You may execute the below command on the CMD next to enable remote desktop connection through Firewall on Windows – 

netsh advfirewall firewall set rule group="remote desktop" new enable=Yes

Enable Remote Desktop using Command Prompt

  • This command will now add a new rule inside your operating system that authorizes enabling Remote Desktop on your computer. 

Now that you have enabled Remote Desktop and allowed its opening through Windows Firewall as well, restart your PC. Sign back into your device again and check if you can access this tool normally. 

How to set up and use Remote Desktop in Windows 10 [Complete Guide]

Disable Remote Desktop using Command Prompt

If you ever change your mind and want to disable using Remote Desktop on your computer, do the following –

  • Open the Run dialog by pressing Windows + R
  • Type CMD on it and press Ctrl + Shift + Enter keys altogether. 
  • Doing so will invoke the Command Prompt having administrative privileges. 
  • On the elevated console, copy/paste the following, and press Enter – 

reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 1 /f

  • The above code will add another entry inside the registry forcing your computer to disable all remote desktop connections on it. 
  • If you are not willing to use Remote Desktop soon, disable its usage through Windows Firewall as well. To do so, you need to run the following code on the same prompt – 

netsh advfirewall firewall set rule group="remote desktop" new enable=No

  • Close the Command Prompt and restart your Windows PC.

Sign back into your device again and you will find the Remote desktop not working on your computer. 

Fix – Black screen issue on Remote Desktop in Windows 10

Activate Remote Desktop using PowerShell

Alternatively, one may also use Windows PowerShell to activate Remote Desktop on a Windows PC. Windows 11 users may go for the terminal and follow the below steps – 

  • Right-click on the Windows icon and select Terminal (Admin). 
  • The User account control will pop up next, hit Yes to authorize accessing the terminal. 
  • On the terminal, copy/paste the following code, and press the Enter key. 

Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server' -name "fDenyTSConnections" -value 0

  • The “Value 0” stands for enabling Remote desktop in the above command. If you ever want to disable this utility program on Windows, just replace the same with “Value 1” and re-run this code. 
  • After this command runs successfully, the remote desktop will be enabled on your computer. However, you might not still open this Remote Desktop. This happens mostly because the Windows Firewall is blocking this app from starting on Windows 11 PCs. 
  • To allow the remote desktop functionality through Windows Firewall, you must run this command on the same terminal – 

Enable-NetFirewallRule -DisplayGroup "Remote Desktop"

Enable Remote Desktop using Terminal or PowerShell

  • After this command runs successfully as well, close the terminal, and restart your PC. 

From the next login, you may use the Remote desktop connection app to access all your computers remotely. 

Five Ways to Disable Remote Desktop Connection on Windows 10 PC

Disable Remote Desktop using PowerShell

To disable using Remote Desktop on Windows PC through PowerShell, use these steps – 

  • Press Win + X, and select Windows Terminal (Admin). 
  • When the UAC prompts, hit Yes to authorize opening this command tool. 
  • The terminal will launch into Windows PowerShell (Admin) by default. 
  • Now, copy/paste the below code on it and press Enter – 

Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server' -name "fDenyTSConnections" -value 1

  • Wait for this command to execute successfully and when this is over, you will find the Remote Desktop protocol disabled on your computer. 
  • In case you want to disable Windows Firewall allowing Remote Desktop, you may execute this command next – 

Disable-NetFirewallRule -DisplayGroup "Remote Desktop"

  • Close the terminal and restart your Windows PC. 

From the subsequent login, you will not find the Remote Desktop running on your computer. 

Fix – Remote desktop licensing mode not configured in Windows 10

Soni Aryan

Soni Aryan

Soni Kumari is a tech enthusiast known for her expertise in how-to type topics and Windows troubleshooting articles. She loves exploring how to do things or tweaks in Android, iPhone, and other operating systems.

Leave a Reply