Remote Desktop mstsc command-line options explained

Learn the mstsc switches that matter, from /v with port 12230 to /admin, /f, /w, /h, /multimon, /public and /edit, and turn them into one-click shortcuts.

  • Intermediate
  • Windows VPS · Admin RDP
  • 5 min read

By RunRacks Team · Published

mstsc.exe is the Remote Desktop Connection client built into every edition of Windows 10 and 11. Most people open its window and type an address, but it also takes command-line switches. With them you can open a session in full screen, at a fixed size, across several monitors or without saving anything on a shared PC, all from one command or desktop shortcut.

Before you start

  • A Windows 10 or 11 PC. mstsc is included in Home, Pro and Enterprise editions.
  • Your server's IP address, username and password from the Dashboard.
  • Remember that RunRacks servers accept Remote Desktop on TCP port 12230, so every address below ends in :12230. The examples use 203.0.113.10; replace it with your own IP.

To see the full list of switches your version supports, run:

Command Prompt
mstsc /?

A help window opens with each option. The list can differ slightly between Windows builds, so treat it as the final word for your PC.

Connect to a server and port with /v

/v: sets the server to connect to. Add the port after a colon:

Command Prompt
mstsc /v:203.0.113.10:12230

Without :12230 the client tries port 3389 and the connection fails on a RunRacks server. You can use a host name instead of an IP if you have set up DNS, for example mstsc /v:rdp.example.com:12230.

Control the window size

These switches decide how big the session is when it opens.

  • /f starts the session in full screen:
Command Prompt
  mstsc /v:203.0.113.10:12230 /f
  • /w: and /h: set the width and height in pixels for a windowed session:
Command Prompt
  mstsc /v:203.0.113.10:12230 /w:1600 /h:900
  • /span stretches one remote desktop across side-by-side monitors as a single large screen.
  • /multimon uses each of your monitors as a separate remote monitor, so maximised windows snap to one screen at a time:
Command Prompt
  mstsc /v:203.0.113.10:12230 /multimon

Session and security switches

  • /admin connects to the server's administrative session. On Windows Server this is the session used for administration rather than a normal Remote Desktop Services session. It does not give you extra sessions or bypass licensing. See Connect to the console session with mstsc /admin for when it helps.
  • /public runs the client in public mode. It does not cache passwords or bitmaps on the local PC. Use it on a shared or borrowed computer:
Command Prompt
  mstsc /v:203.0.113.10:12230 /public
  • /prompt always asks for credentials, even if a password is already saved for that address.
  • /shadow:<ID> with /control lets an administrator view or control another user's session. It is run from a session on the server and is covered in its own guide.

Open and edit .rdp files

mstsc can also work with saved connection files.

  • Open a saved file directly:
Command Prompt
  mstsc "C:\Users\admin\Desktop\server1.rdp"
  • Open the file in the settings window so you can change it, then save:
Command Prompt
  mstsc /edit "C:\Users\admin\Desktop\server1.rdp"

You can combine a file with switches. Switches on the command line override the matching line in the file for that launch only. For example, this opens the saved connection in full screen even if the file says windowed:

Command Prompt
mstsc "C:\Users\admin\Desktop\server1.rdp" /f

The lines inside an .rdp file are explained in Create and edit .rdp files: the settings that matter.

Build a quick-launch shortcut

A desktop shortcut can hold any of the commands above.

  1. Right-click an empty part of the desktop and choose New → Shortcut.
  2. For the location, enter the full command, for example:
Text
   mstsc.exe /v:203.0.113.10:12230 /w:1600 /h:900
  1. Click Next, give the shortcut a name such as Trading server, then click Finish.
  2. Right-click the shortcut and choose Pin to taskbar or Pin to Start if you want it one click away.

For a batch of servers you can also use a small PowerShell script:

PowerShell
$servers = '203.0.113.10:12230', '198.51.100.20:12230'
foreach ($s in $servers) { Start-Process mstsc -ArgumentList "/v:$s" }

This opens one Remote Desktop window per server. You still sign in to each one.

Check it works

  1. Run mstsc /v:203.0.113.10:12230 from Win + R. The credential prompt should show your server's IP.
  2. Sign in and confirm the window size or full screen matches the switch you used.
  3. Inside the session, right-click the desktop and open Display settings. The resolution should match the /w and /h values you chose, or your monitor size when using /f.

If the credential prompt does not appear at all, test the port first:

PowerShell
Test-NetConnection 203.0.113.10 -Port 12230

TcpTestSucceeded : True means the network path is fine.

Troubleshooting

  • "Remote Desktop can't connect to the remote computer": the address is missing :12230 or has a typo. Check there is no space between the IP and the colon.
  • Switch seems ignored: the .rdp file you opened may set a conflicting value, or your Windows edition does not support that feature. Run mstsc /? to confirm the switch exists on your build.
  • /w and /h give a blurry picture: the size does not match your display scaling. Try full screen with /f instead, or see Use Remote Desktop with multiple monitors and display scaling.
  • Shortcut opens the wrong server: right-click the shortcut, choose Properties and check the Target field for the full command and address.

Next steps

Was this guide helpful?

Still stuck?

Ask RunRacks AI for a quick answer, or open a ticket and our team will take a look at your server.

Windows VPS & RDP

Allow or block multiple RDP sessions for one user

Understand why a new Remote Desktop login takes over your old session, how the single-session policy works on Windows Server, and which setting suits a team.

  • Advanced
  • Windows VPS
  • 5 min read