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
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 the Dashboard.
- Remember that RunRacks servers accept Remote Desktop on TCP port 12230, so every address below ends in
:12230. 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:12230Without :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.
/fstarts the session in full screen:
mstsc /v:203.0.113.10:12230 /f/w:and/h:set the width and height in pixels for a windowed session:
mstsc /v:203.0.113.10:12230 /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:12230 /multimonOn 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:12230 /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:12230 /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: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.
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:12230from 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 12230TcpTestSucceeded : True means the network path is fine.
Troubleshooting
- "Remote Desktop can't connect to the remote computer": the address is missing
:12230or 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. - Review the basics of the port: RunRacks RDP port 12230.
- Need a server to connect to? See Windows VPS plans.
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.
Related guides
Windows VPS & RDP
RunRacks RDP port 12230: how to connect to your Windows VPS and Admin RDP
RunRacks Windows VPS and Admin RDP servers accept Remote Desktop on port 12230, not 3389. Here is how to connect from every device and keep the port open.
- Beginner
- Windows VPS · Admin RDP
- 5 min read
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
Windows VPS & RDP
Create Windows users with Remote Desktop access
Give each person their own Windows login, add them to Remote Desktop Users, test the account and remove access cleanly later.
- Beginner
- Windows VPS · Admin RDP
- 2 min read