How to Run Commands to Enable and Launch Remote Desktop
Accessing a remote desktop using the run command is a quick and efficient way to connect to another computer.
While enabling and using Remote Desktop Protocol (RDP) can be done through a graphical user interface (GUI), using the run command for remote desktop provides a more direct method.
Here, we'll show you how to enable and launch Remote Desktop using these commands as a straightforward way to access any resources and perform tasks on a remote device.
Quick Steps
- To enable Remote Desktop on the target device: run cmd as Administrator > enter the command > verify the change > open firewall rule for RDP.
- To launch Remote Desktop on the controlling PC: open Run Dialog box > type mstsc and enter > type the credentials to the remote PC.
- To disable Remote Desktop on the target device: run cmd as Administrator > enter the command.
Enable Remote Desktop via Command Prompt on Target Device
To use Remote Desktop, you need to enable the feature on the target device, which activates RDP. The most common way to do this is through Command Prompt or PowerShell. We'll show you how to use Command Prompt, which is quick and simple.
Step 1: Press the Windows key and type cmd. Right-click on Command Prompt and select Run as administrator.
Step 2: Enable RDP by typing this command and pressing Enter:
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f
fDenyTSConnections
value within the Terminal Server
key. Setting this value to 0
enables RDP connections.Step 3: Enter the following command to verify the change.
reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections
Step 4: Enter the following command to open the firewall and ensure remote access is unrestricted.
netsh advfirewall firewall set rule group="remote desktop" new enable=Yes
Now, you will see the below command that's meant the remote desktop function has been updated.
Part 2: How to Run Commands to Launch Remote Desktop
Once RDP is enabled, you can initiate remote connections using the mstsc command-line tool. The mstsc command creates a connection to a remote desktop session host server or other remote computer.
Step 1: Tap Win + R to open Run Dialog box and enter mstsc, then hit Enter.
Step 2: Enter the information of the remote device you want to access.
Step 3: Enter the username and password for the remote computer to complete the connection.
mstsc /console
This command establishes a remote connection in console mode. The remote desktop session will lack a graphical interface and function more like a command prompt on the target machine. This is useful for server administration tasks where a graphical environment is not necessary.
mstsc /f
The /f flag launches the remote desktop session in full-screen mode. This fills your local machine's display entirely with the remote desktop, providing a more immersive experience.
mstsc /v <computer_name_or_ip_address>
This command format allows you to specify the target computer for the remote connection. Replace <computer_name_or_ip_address>
with the actual hostname or IP address of the remote machine you want to access.
How to Disable Remote Desktop with Command Prompt
If you need to disable RDP on the targeted device later, use the following command in Command Prompt (as administrator):
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 1 /f
netsh advfirewall firewall set rule group=" remote desktop" new enable=No
Bonus: Best Remote Desktop Solution for Individuals/Businesses
Does your Windows edition not support Remote Desktop? Or you don't want to run tedious commands to enable and launch Remote Desktop? AirDroid Remote Support, one of the best Windows remote desktop software brings you the solution!
With AirDroid Remote Support, you can remotely control Windows, whether it's a personal computer or a computer deployed by an organization. It speeds up troubleshooting and has advanced features such as lightweight management.
Final Notes
In a nutshell, enabling and running Remote Desktop with commands empowers users with a powerful and versatile tool for remote access.
Whether you're a system administrator managing a network of computers or a personal user needing to access a home machine remotely, understanding these command-line techniques can significantly enhance your workflow and provide greater control over your remote desktop connections.


Leave a Reply.