Remote Desktop Connection is one of the most common Windows admin tools, but the executable name is easy to forget because it is not called rdp.exe. The built-in command is mstsc, short for Microsoft Terminal Services Client.

If you connect to servers or workstations regularly, knowing the command is useful because you can launch sessions faster, pass connection flags, and reuse .rdp configuration files.

Command to Open Remote Desktop

The basic command is:

Command
mstsc

That opens the normal Remote Desktop Connection window.

Connect Straight to a Host

If you already know the hostname or IP, skip the manual prompt:

Command
mstsc /v:192.168.1.50

You can replace the address with:

  • an IPv4 address
  • an IPv6-capable hostname
  • a DNS name such as server01.contoso.local

Useful mstsc Flags

These are the switches most admins actually use:

Flag Purpose
/v:HOST Connect directly to a specific host
/f Full-screen mode
/w:1280 /h:720 Set custom window size
/admin Open an administrative session when applicable
/public Reduce credential and cache persistence on shared systems
/span Span across multiple monitors
/multimon Use multiple monitors more cleanly on supported setups

Example:

Command
mstsc /v:server01.local /f /admin

That is a common server-maintenance pattern.

Use an RDP File Instead of Typing Everything

If you connect to the same environment often, save a .rdp file and launch it directly:

Command
mstsc C:\Users\admin\Desktop\prod-server.rdp

That is useful when you want a repeatable session profile with:

  • display settings
  • local resource redirection
  • gateway settings
  • username hints

How to Enable Remote Desktop from CMD

If you are on the target machine locally and RDP is disabled, you can enable it from an elevated shell.

First enable Remote Desktop in the registry:

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

Then allow the firewall rules:

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

On managed environments, group policy or endpoint controls may still override this, so treat these commands as the local-side prerequisites, not a guarantee.

Common RDP Problems

"Remote Desktop can't connect to the remote computer"

Check:

  • the host is reachable on the network
  • DNS resolves correctly
  • TCP 3389 is allowed where required
  • Remote Desktop is enabled
  • the target edition of Windows supports inbound RDP

Black screen after connecting

This can be caused by GPU/driver issues, shell startup problems, stuck sessions, or bandwidth-sensitive display settings. Testing with a lower resolution can help isolate it.

Credentials work locally but not over RDP

Check local security policy, NLA requirements, account rights such as Allow log on through Remote Desktop Services, and whether the account is locked or restricted.

Security Notes

RDP is powerful, which means exposure matters.

Good practice includes:

  • avoid exposing RDP directly to the public internet
  • place it behind VPN, Zero Trust access, or an RD Gateway
  • use MFA where possible
  • review failed login attempts and lockout events
  • keep the host patched

If you are publishing RDP openly and guessing that strong passwords are enough, that is not a serious security posture.

When mstsc Is Better Than the GUI Path

mstsc shines when:

  • you are already in an admin shell
  • you want to script or document connections
  • you use different profiles for different environments
  • you need switches like /admin or /public

Bottom Line

To start Remote Desktop from CMD:

Command
mstsc

To connect directly:

Command
mstsc /v:server01.local

If you use RDP regularly, learning mstsc and a few switches saves time and makes your remote-access workflow more predictable.