A saved .rdp file is the difference between a five-minute connection ritual and a double-click. If you administer one Windows VPS you probably type the same host, port, username and display options every day; if you manage ten, the ritual becomes overhead and mistakes. RDP files are plain text, portable between mstsc versions, and can carry Remote Desktop Gateway settings, redirected drives and saved credentials — but only if you author them deliberately instead of letting mstsc dump its defaults.
This guide covers the properties that actually matter on a hosted Windows Server instance: gateway blocks, credential handling, multi-monitor and scaling settings, and the security trade-offs of embedding passwords. If you are still deciding how you reach the server in the first place, our Windows VPS guides cover the initial connection path; here we assume you already have working credentials.
What an .rdp File Actually Contains
An .rdp file is an INI-style text file. Every line is key:value, and mstsc ignores unknown keys, which makes the format forgiving and forward-compatible. The minimum viable file for a VPS is four lines: full address:s:vps.example.com:3389, username:s:Administrator, prompt for credentials:i:1, and administrative session:i:0. Save it as prod-web.rdp and double-click.
You can generate a template by connecting once with mstsc, clicking Show Options → Save As. That file will be littered with defaults from your local machine — conflicting window sizes, local printer redirection, clipboard settings you may not want. Treat the generated file as a reference, not a deliverable. The clean approach is to start from a blank text file and add only what the connection needs.
One operational note: Windows associates .rdp by extension, and Remote Desktop Connection is present on all Pro, Enterprise and Server editions. Microsoft Store “Windows App” (the successor client) also opens .rdp files and honours the same keys, so a file authored today works on the newer client without edits.
Display Settings That Survive Reconnects
Dynamic resolution is the single most useful setting on a VPS. smart sizing:i:1 scales the remote desktop to fit the client window; dynamic resolution:i:1 resizes the remote session when you resize the window or move it between monitors with different DPI. On Server 2012 R2 and later this works well, but it requires the RDP service to negotiate a new display, so expect a half-second black flash on each resize.
For multi-monitor work, use multimon:i:1 spans the session across all local screens. On very high DPI laptops set desktopscalefactor:i:125 (or 150) to avoid a hairline UI on the remote side. If you need a fixed desktop for a VNC-style admin tool or screenshot automation, pin it with desktopwidth:i:1920 and desktopheight:i:1080 instead of dynamic resolution.
Colour depth matters more than people expect on metered or high-latency links. session bpp:i:32 is the default; dropping to 16 or 15 cuts bandwidth substantially over a long-haul connection and is almost invisible for terminal and admin work. Pair that with bandwidthautodetect:i:1 and leave networkautodetect:i:1 enabled so RDP adapts to congestion rather than stalling.
Gateway Blocks for Servers Behind NAT
If your provider fronts RDP with a Remote Desktop Gateway, or you run RD Gateway yourself to avoid exposing 3389, the gateway block replaces the direct connection. The required keys are gatewayhostname:s:rdg.example.com, gatewayusagemethod:i:1 (always use gateway) or 2 (use gateway if direct fails), gatewaycredentialssource:i:4 (prompt for password), and gatewayprofileusagemethod:i:1 to force the gateway settings over any server-supplied profile.
In organisations using NPS with a Remote Desktop connection authorisation policy, the gateway also enforces Group Policy Set RD Gateway authentication method. If the .rdp says “ask for password” but policy demands smart card or OTP, the connection fails with the generic “Your computer can’t connect to the remote computer” dialog and the real reason only appears in the gateway’s Event Viewer under Microsoft-Windows-TerminalServices-Gateway/Operational (event 302 or 304).
A subtle trap on hosted VPS: the provider’s gateway may present a certificate whose SAN does not include the hostname you typed. RDP validates it against gatewayhostname, so use the name from the certificate exactly — usually a regional FQDN — rather than the friendly label in the control panel.
Credentials: Saved vs Prompted
Three keys control authentication. prompt for credentials:i:1 always asks. prompt for credentials on client:i:1 asks on the local machine even when the server supports single sign-on. authentication level:i:2 requires server authentication and will refuse to connect to a host with a self-signed or expired certificate — you get the “identity of the remote computer cannot be verified” warning and, with level 2, a hard failure.
Never put a password in the file. The password 51:b: key stores a DPAPI-encrypted blob bound to the machine and user that created it; it silently fails on another PC and leaves a credential artefact on disk. If you need unattended connections, create a Windows Credential Manager entry with cmdkey /generic:TERMSRV/vps.example.com /user:Administrator /pass, then set prompt for credentials:i:0. That keeps the secret in the credential store where it can be audited and revoked, not in a file someone will eventually zip and email.
For domain-joined servers, enablecredsspsupport:i:1 is required for CredSSP/NLA. Turning it off to “fix” an authentication error downgrades you to plain RDP security and is a genuine security regression on an internet-facing host.
Redirecting Drives, Clipboard and Devices
Redirection keys are where convenience meets policy. drivestoredirect:s:* maps every local drive, which on a shared workstation can expose entire disks to the remote session. Prefer explicit mapping: drivestoredirect:s:C:\;D:\Projects\. Clipboard is binary: redirectclipboard:i:1. Printer redirection via redirectprinters:i:1 is slow to enumerate and often breaks on hosts without a matching driver.
Note that server-side Group Policy overrides client requests. If Computer Configuration → Administrative Templates → Windows Components → Remote Desktop Services → Remote Desktop Session Host → Device and Resource Redirection → Do not allow drive redirection is Enabled, your carefully crafted .rdp is silently ignored. When debugging a redirection failure, check the server policy first and the file second.
Keeping a Library of RDP Files Under Control
Once you have more than a handful of hosts, treat .rdp files as configuration: keep them in a git repository, name them by role and environment (prod-iis-01.rdp), and never commit anything containing a credential blob. A short header comment is legal in the file and helps: lines beginning with a comment character are ignored by mstsc but make the file self-documenting.
For bulk administration, mstsc /v:host /f and the PowerShell Invoke-RDUserLogoff cmdlet cover the rest; the .rdp file is for repeatable interactive access. If you are still sizing the instance itself rather than tuning the client, compare Windows VPS plans against your session count, because RDP smoothness is as much a function of vCPU and RAM as of any client setting.



