If you want to use the Remote Desktop feature without opening the Windows Settings panel, then you can enable Remote Desktop using Command Prompt or Windows PowerShell. If you have a remote desktop client on your mobile or another computer, you will be able to connect it and use your PC remotely.
Remote Desktop is a well-known facility for Windows 11/10 computers that lets you connect two computers or mobile so that an individual can access another computer remotely. You can fix some problems on the computer via mobile or do other jobs according to your requirements. You need a Remote Desktop client like Microsoft Remote Desktop or so on your mobile to connect two devices.
It is possible to enable to disable Remote Desktop via Windows Settings. You need to head to System > Remote Desktop to access the option. However, let’s assume that the Windows Settings panel is not opening due to some reasons, and you need to turn on the Remote Desktop feature. Then you can use this method to start the Remote Desktop using the command line.
Enable Remote Desktop using Command line
To enable Remote Desktop using Command Prompt and Windows PowerShell, follow these steps-
- Open Command Prompt or PowerShell with administrator privilege
- Set value of fDenyTSConnections REG DWORD to 0
- Add a Firewall rule
- Restart your computer
- Start using Remote Desktop in Windows 10.
The commands are not the same for Command Prompt and Windows PowerShell.
1] Enable RDP firewall using Command Prompt
To get started, open the Command Prompt with administrator privilege. You can search for it in the Taskbar search box, and click the Run as administrator option that appears on your screen. After that, enter this following command and hit Enter:
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f
By default, the value of fDenyTSConnections is set to 1. This command will change the value to 0.
Next, execute the following command:
netsh advfirewall firewall set rule group="remote desktop" new enable=yes
This command will add and update three rules in the Firewall so that you can start using the Remote Desktop.
2] Enable RDP using Windows PowerShell
You need to open the Windows PowerShell with administrator privilege and enter the following command and hit Enter:
Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server'-name "fDenyTSConnections" -Value 0
This command will change the fDenyTSConnections value to 0. Now, you need to execute the following command to add rules in the Firewall:
Enable-NetFirewallRule -DisplayGroup "Remote Desktop"
After that, you will be able to use Remote Desktop in Windows 10.
In case you want to disable Remote Desktop using Command Prompt and Windows PowerShell, you need to enter these steps.
Related: Remote Desktop option is greyed out.
Disable Remote Desktop using Command Prompt or PowerShell
To disable Remote Desktop using Command Prompt and Windows PowerShell, follow these steps-
- Open Command Prompt or PowerShell with administrator privilege
- Set value of fDenyTSConnections REG DWORD as 1
- Add a Firewall rule
- Restart computer.
To know more, you need to read on.
Disable Remote Desktop using Command Prompt
You need to set the default value of fDenyTSConnections as 1. For that, use this command-
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 1 /f
Now you need to remove rules from the Firewall. For that, use this command-
netsh advfirewall firewall set rule group="remote desktop" new enable=No
Disable Remote Desktop using PowerShell
You need to change the value of fDenyTSConnections as 1. You can do that by using this command-
Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server'-name "fDenyTSConnections" -Value 1
The second command will let you remove the rules from the Firewall:
Disable-NetFirewallRule -DisplayGroup "Remote Desktop"
How do I know if RDP is enabled or not?
If you want to know the status of the RDP protocol on your Windows 11/10 system, then open the Registry Editor. After that, access the Terminal Services and Terminal Server Registry keys. There, look for the fDenyTSConnections DWORD (32-bit) Value. If the value data of this value is set to 0, then RDP is enabled. If it is set to 1, then RDP is disabled.
How to restart the RDP service using PowerShell?
If you want to restart the Remote Desktop Services using PowerShell, then first open the Windows PowerShell as administrator. After that, execute the command given below:
Restart-Service -Force -DisplayName "Remote Desktop Services"
You can also use the following command to restart the RDP service:
Restart-Service -Force -Name "TermService"
That’s all! I hope this simple tutorial will be helpful for you.