Enable Remote Desktop – Command Line on Windows 10 and 11
- HelpWire
- →
- Blog
- →
- Definitive Guide to using Microsoft Remote Desktop
- →
- How To Enable Remote Desktop From Command Line
How to have CMD enable Remote Desktop? RDP settings are primarily located in the Windows registry, and the GUI Registry Editor can be clunky. That’s why CMD commands are a tempting option. Windows 10 Remote Desktop setup via CMD is different from Windows 11, so choose your system and follow one of our short guides. You should also consider HelpWire as an alternative to RDP that doesn’t require terminal commands or registry editing.
How to Enable Remote Desktop - Windows 11 Command Line
In Windows 11, the CMD prompt has been integrated into the general Terminal interface, making it easier to open a command prompt instance with admin access, but it may be unfamiliar to the experienced users of previous Windows releases.
-
Press Win+X and select “Terminal (Admin)”. Confirm that you grant administrative access to the app.
-
Click the arrow next to the “+” that opens a new tab, and select “Command Prompt”. Any tabs opened in an Administrator Terminal will also have admin rights.
-
Copy and paste the following commands, press “Enter” to confirm:
reg add
“HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server” /v fDenyTSConnections /t REG_DWORD /d 0 /f
netsh advfirewall firewall set rule group=”remote desktop” new enable=Yes
If the commands were entered correctly, you will see confirmation messages for both of them. Note that there are additional MSTSC command line options to configure RDP.
How to Enable Remote Desktop in Windows 10 CMD Prompt
-
Press Win+R to open the Run window, and enter “CMD”.
-
Press Ctrl+Shift+Enter to run the command with admin rights, and confirm when asked to grant the rights.
-
Paste these commands:
reg add
“HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server” /v fDenyTSConnections /t REG_DWORD /d 0 /f
netsh advfirewall firewall set rule group=”remote desktop” new enable=Yes
The terminal will confirm that the commands were completed successfully.
Things to Note When You Enable RDP via CMD
If you use a command to enable Remote Desktop and disable the firewall, there’s a risk of unwanted access to your operating system. It’s unlikely, since RDP access also requires your username and password, but a weak password can let the malicious actor through. If you’re done using RDP for now, use this command to disable RDP again:
reg add “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server” /v fDenyTSConnections /t REG_DWORD /d 0 /f
Since CMD is a legacy feature, it’s best to adapt to newer tools, such as using PowerShell to configure Remote Desktop Protocol. PowerShell supports a lot more features, such as automation, and can access a lot more system functions than CMD.