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.
mstscis included in Home, Pro and Enterprise editions. - Your server's IP address, username and password from your VPS provider's control panel.
- Remember that servers accept Remote Desktop on TCP port 3389, so every address below ends in
:3389. The examples use203.0.113.10; replace it with your own IP.
To see the full list of switches your version supports, run:
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:
mstsc /v:203.0.113.10:3389You can use a host name instead of an IP if you have set up DNS, for example mstsc /v:rdp.example.com:3389.
Control the window size
These switches decide how big the session is when it opens.
/fstarts the session in full screen:
mstsc /v:203.0.113.10:3389 /f/w:and/h:set the width and height in pixels for a windowed session:
mstsc /v:203.0.113.10:3389 /w:1600 /h:900/spanstretches one remote desktop across side-by-side monitors as a single large screen./multimonuses each of your monitors as a separate remote monitor, so maximised windows snap to one screen at a time:
mstsc /v:203.0.113.10:3389 /multimonNote: On some newer Windows 11 builds, mstsc /l lists your monitors with their IDs. You can then pick specific screens with the selectedmonitors line in an .rdp file instead of using all of them.
Session and security switches
/adminconnects 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./publicruns the client in public mode. It does not cache passwords or bitmaps on the local PC. Use it on a shared or borrowed computer:
mstsc /v:203.0.113.10:3389 /public/promptalways asks for credentials, even if a password is already saved for that address./shadow:<ID>with/controllets 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:
mstsc "C:\Users\admin\Desktop\server1.rdp"- Open the file in the settings window so you can change it, then save:
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:
mstsc "C:\Users\admin\Desktop\server1.rdp" /fThe 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.
- Right-click an empty part of the desktop and choose New → Shortcut.
- For the location, enter the full command, for example:
mstsc.exe /v:203.0.113.10:3389 /w:1600 /h:900- Click Next, give the shortcut a name such as Trading server, then click Finish.
- 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:
$servers = '203.0.113.10:3389', '198.51.100.20:3389'
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.
Tip: Shortcuts made from switches do not store your username. If you want the username remembered too, save an .rdp file instead and point the shortcut at it.
Check it works
- Run
mstsc /v:203.0.113.10:3389from Win + R. The credential prompt should show your server's IP. - Sign in and confirm the window size or full screen matches the switch you used.
- Inside the session, right-click the desktop and open Display settings. The resolution should match the
/wand/hvalues you chose, or your monitor size when using/f.
If the credential prompt does not appear at all, test the port first:
Test-NetConnection 203.0.113.10 -Port 3389TcpTestSucceeded: True means the network path is fine.
Troubleshooting
- "Remote Desktop can't connect to the remote computer": the address is missing
:3389or has a typo. Check there is no space between the IP and the colon. - Switch seems ignored: the
.rdpfile you opened may set a conflicting value, or your Windows edition does not support that feature. Runmstsc /?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
/finstead, 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
- Save connections with the username included: Save a Remote Desktop connection as a one-click shortcut.
- Learn every useful
.rdpline: Create and edit.rdp files.
