How to Force Remote Desktop Sessions to Open on Specific Monitor in Dual-Screen Setup Using RDP Configuration


2 views

When working with Remote Desktop Protocol (RDP) on multi-monitor systems, Windows typically remembers the last used monitor position for each connection. However, this behavior isn't always consistent, especially with different RDP client versions or when connecting to various servers.

The key to controlling monitor behavior lies in these RDP file parameters:


screen mode id:i:2
use multimon:i:1
selectedmonitors:s:1,2
winposstr:s:0,1,1440,0,2400,900

The winposstr parameter is particularly important - it stores the window position data in a comma-separated format representing left,top,right,bottom coordinates.

To consistently open RDP sessions on your secondary monitor, you'll need to:

  1. Open an RDP session and position it on your desired monitor
  2. Close the session properly (don't just disconnect)
  3. The position should now be remembered for that specific connection

For programmatic control, you can modify the RDP file with a PowerShell script:


# PowerShell script to modify RDP file monitor position
$rdpContent = @"
screen mode id:i:2
use multimon:i:1
selectedmonitors:s:2
winposstr:s:1440,0,2400,900,1440,0
"@

Set-Content -Path "MyConnection.rdp" -Value $rdpContent

When dealing with complex multi-monitor setups, you might need to use the selectedmonitors parameter more precisely:


# Example for spanning across specific monitors
selectedmonitors:s:1,3  # Uses monitor 1 and 3 in a 3-monitor setup
selectedmonitors:s:2    # Uses only monitor 2

If the RDP session keeps reverting to the primary monitor:

  • Check for multiple RDP client versions on your system
  • Verify monitor IDs haven't changed (especially after driver updates)
  • Try deleting all *.rdp files in %UserProfile%\Documents and recreating them

For system-wide control, you can modify these registry keys:


Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client]
"Default Monitor"=dword:00000002

Note: This affects all new RDP connections and should be used cautiously.


When working with Remote Desktop Protocol (RDP) in dual-monitor environments, you might notice that sessions don't consistently open on your preferred display. This becomes particularly frustrating when you've saved multiple .RDP connection files that each behave differently.

By default, Remote Desktop (mstsc.exe) follows these rules for monitor placement:

  • New sessions open on the monitor where the mstsc.exe window was last closed
  • If no previous session exists, it typically defaults to the primary monitor
  • The behavior isn't controlled by .RDP file parameters

The most reliable method involves modifying Windows Registry settings for Remote Desktop:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client]
"RemoteDesktop_SuppressWhenMinimized"=dword:00000002
"RemoteDesktop_Placement"=hex:2c,00,00,00,00,00,00,00,01,00,00,00,ff,ff,ff,ff,\
  ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,ff,64,00,00,00,64,00,00,00

For more dynamic control, consider this AutoHotKey script that forces RDP windows to your secondary monitor:

#IfWinActive ahk_class TscShellContainerClass
WinWait, ahk_class TscShellContainerClass
WinGetPos,,, width, height
SysGet, MonitorWorkArea, MonitorWorkArea, 2
WinMove, A,, MonitorWorkAreaLeft, MonitorWorkAreaTop, width, height
return

Create a batch file to launch RDP sessions with specific coordinates:

@echo off
set "monitor2_x=1920"
set "monitor2_y=0"
start mstsc.exe /w:1600 /h:900 /v:yourserver /restrictedAdmin
timeout /t 2 >nul
powershell -command "(New-Object -ComObject WScript.Shell).AppActivate('Remote Desktop Connection');"
powershell -command "$wshell = New-Object -ComObject wscript.shell; $wshell.SendKeys('%% ')"
powershell -command "[System.Windows.Forms.SendKeys]::SendWait('{DOWN}{RIGHT}');"
powershell -command "[System.Windows.Forms.Cursor]::Position = New-Object System.Drawing.Point(%monitor2_x%, %monitor2_y%)"
  • These solutions work with Windows 7/10/11 clients
  • Server OS version doesn't affect client-side window placement
  • Multiple RDP sessions will stack on your secondary monitor
  • Remember to backup your registry before making changes