An .rdp file stores everything about one Remote Desktop connection: the server address, the screen size, which local devices are shared and how audio behaves. It is plain text, so you can read and change it in Notepad. This guide explains the lines worth knowing, so you can build a reliable connection file for your server and share it without leaking anything sensitive.
Before you start
- A Windows 10 or 11 PC with Remote Desktop Connection (
mstsc). - Your server's IP address and username from your VPS provider's control panel.
- Windows VPS and Admin RDP servers listen on TCP port 3389, so the address line must include
:3389.
Create a starting file
The easiest way to get a valid file is to let mstsc write it.
- Press Win + R, type
mstscand press Enter. - Click Show Options.
- On the General tab, enter
203.0.113.10:3389as the computer and your username. - Click Save As and save it, for example as
server1.rdpon your desktop.
You now have a file with sensible defaults that you can edit.
Open the file in Notepad
Double-clicking an .rdp file connects straight away, so open it for editing instead:
- Right-click the file and choose Open with → Notepad, or
- run
notepad "C:\Users\admin\Desktop\server1.rdp".
Each line has three parts separated by colons: the setting name, a type (s for text, i for a number, b for binary) and the value. For example:
full address:s:203.0.113.10:3389Save the file in Notepad when you are done. Keep the existing encoding; Notepad does this by default.
Tip: You can also edit settings in the normal window with mstsc /edit "C:\Users\admin\Desktop\server1.rdp" and then click Save.
Address and sign-in lines
full address:s:203.0.113.10:3389
username:s:admin
prompt for credentials:i:0
administrative session:i:0full addressis the server and port. Use a host name such asrdp.example.com:3389if you have one.usernamepre-fills the user name. On Admin RDP use the exact username from your VPS provider's control panel.prompt for credentials:i:1always asks for a password, even if one is saved in Windows.administrative session:i:1is the file version ofmstsc /admin.
Display lines
screen mode id:i:2
desktopwidth:i:1920
desktopheight:i:1080
use multimon:i:0
session bpp:i:32
smart sizing:i:1
dynamic resolution:i:1screen mode idis1for a window and2for full screen.desktopwidthanddesktopheightset the resolution when you use a window.use multimon:i:1spreads the session across all your monitors.session bppis colour depth.32looks best;16saves bandwidth on slow links.smart sizing:i:1scales the picture when you resize the window instead of adding scrollbars.dynamic resolution:i:1lets the remote desktop resize to match the window.
Redirection lines
These control which local resources the server can use.
redirectclipboard:i:1
redirectprinters:i:0
drivestoredirect:s:
redirectsmartcards:i:0redirectclipboard:i:1enables copy and paste between your PC and the server.redirectprinters:i:1makes your local printers available in the session.drivestoredirectlists local drives to share. Leave it empty to share none, use*for all drives, or name one drive such asD:\;. Sharing only what you need is safer.redirectsmartcards:i:1passes your smart card reader through.
Audio lines
audiomode:i:0
audiocapturemode:i:0audiomodeis0to play sound on your PC,1to leave it on the server, or2for no sound.audiocapturemode:i:1sends your microphone to the server.
Reconnect and network lines
autoreconnection enabled:i:1
autoreconnect max retries:i:20
connection type:i:7
networkautodetect:i:1
bandwidthautodetect:i:1autoreconnection enabled:i:1makes the client try again when the network drops.connection type:i:7with the two auto-detect lines lets the client choose quality based on the link. Lower values with auto-detect off force a fixed profile, which can help on very slow connections.
Share a file safely
An .rdp file is handy for colleagues, but treat it with some care.
mstscdoes not write your password into the file as plain text. Saved passwords live in Windows Credential Manager on your own PC, not in the file.- The file does show the server address and, if set, the username. Send it only to people who should have access.
- Before sharing, remove or blank the
usernameline so each person signs in with their own account. Each team member should have a separate Windows user. - If you shared all drives with
drivestoredirect:s:*, change it to a single folder or empty value first.
Warning: Never paste the server password into a chat or email next to the .rdp file. Share the password through a password manager instead.
Check it works
- Save the file and double-click it.
- Confirm the connection prompt shows
203.0.113.10:3389and your username. - After signing in, check the screen mode, clipboard and drives behave as you set them. In File Explorer inside the session, shared drives appear under This PC as Drive on your-pc-name.
Troubleshooting
- Changes are ignored: you may have edited a copy while opening another file. Check the path, or open it with
mstsc /editto confirm the values. - Notepad shows odd spacing between letters: that is just the file's Unicode encoding. Edit as normal and save without changing the encoding.
- Windows warns that the publisher is unknown: this is normal for files you create yourself. It is shown because the file is not signed. Check the address and click Connect.
Next steps
- Launch connections with switches: Remote Desktop mstsc command-line options explained.
- Pin your file for one-click access: Save a Remote Desktop connection as a one-click shortcut.
- Fine-tune sharing of local disks: Share local drives with your server over Remote Desktop.
