9

Is there any way to make Remote Desktop v6 open on a specific monitor in a dual monitor setup?

I know it supports dual monitors and it is easy to make it use both monitors, but what I really want is for all of my RDP sessions to open on my secondary monitor. I save all of my frequently used connections in .RDP files and currently I have a mish-mash where some open on my primary and other on my secondary monitor.

In browsing through the RDP file I can't discern what setting is controlling this (I suspect it is not in this file).

So, how do I control this? I'm running Win7 as my client by the way, and connecting almost exclusively to Server 2008 R2 machines.

BrettRobi
  • 357
  • 2
  • 4
  • 10
  • What if you just move the RDC window to the secondary monitor before clicking 'connect'? That should open RDP session on that monitor, and might remember where to start RDC next time. – chronos Jun 04 '10 at 17:49
  • 1
    Nope, that has no effect. – BrettRobi Jun 04 '10 at 18:01
  • That has no effect for all RDP sessions, or only for full-screen sessions? If that does work for non-fullscreen sessions, then I'd suggest opening sessions non-fullscreen on the secondary monitor, and after that configuring them to be full-screen again; hopefully, they will stay there on the next connect. (I'm just guessing here, sorry if that doesn't work.) – chronos Jun 04 '10 at 18:06
  • I'm not seeing any difference whether it is full screen or not. I switched to 10x7 resolution, opened a session (first moving the RDP logon window to 2nd screen), moved session to the 2nd monitor, ended the session and opened it again with no difference. – BrettRobi Jun 04 '10 at 18:33

4 Answers4

15

There are screen position and mode options in the RDP file which control this by setting the RDP Client window position and size but there aren't explicit options that specify which monitor, you will have to work with the settings and choose ones that deliver the results you want on your combination of monitors. You can also independently set the remote desktop width and height within the window area you define.

The key settings are

winposstr:s:0,m,l,t,r,b
m = mode ( 1 = use coords for window position, 3 = open as a maximized window )
l = left
t = top
r = right  (ie Window width)
b = bottom (ie Window height)

The l,t coordinates are relative to the standard Windows origin where (0,0) is the upper left of the virtual desktop and the r,b values are absolute width and height so:

winposstr:s:0,1,100,100,800,600

Opens up a 800x600 window 100 pixels in from the left edge of your leftmost monitor and 100 pixels down from the upper edge.

The Screen Mode option tells the TS Client to open in either Windowed or Full Screen mode

screen mode id:i:x

Set x to 1 for Window mode and 2 for the RDP "Full Screen" mode. The TS client will choose the best monitor in the latter mode depending on which physical monitor has the best overlap with the t,l,r,b requirements in the winposstr setting.

The remote desktop size is set by the following two rdp file settings.

desktopwidth:i:x
desktopheight:i:y

Where x and y are the dimensions of the desktop you want in pixels. Obviously if this is larger than the window size you choose you will have scroll bars to deal with and if it's smaller then you will have unused space around the desktop. If you are opting for a Windowed mode then the Window size you choose must be larger than the remote desktop size by some number of pixels that will vary depending on the dpi of your desktop but traditionally this would have been about 6 extra pixels in width and 27 or so in height (for the title bar).

The Remote Desktop Blog has an article on this that you can find here. There is some detailed additional in depth analysis of the interrelationship between these settings in this article on the Ohman Automation Corp website.

Glorfindel
  • 1,213
  • 4
  • 15
  • 22
Helvick
  • 20,019
  • 4
  • 38
  • 55
  • 1
    Interestingly, this topic and that same link to the TS blog appeated on Raymond Chen's blog today (http://blogs.msdn.com/b/oldnewthing/archive/2010/07/08/10035641.aspx) – Ben Pilbrow Jul 08 '10 at 20:48
  • Which is exactly what reminded me about this question as it had been bugging me for a while. Probably should have acknowledged Raymond Chen's pointer though - at least you've sorted that out. +1 – Helvick Jul 08 '10 at 20:58
  • Yes, his blog is a very good read - you can find out some rather interesting and useful things from him. – Ben Pilbrow Jul 08 '10 at 21:23
  • Thanks guys. You've at least confirmed for me that one can't directly specify the monitor to use in the rdp file. Since I have two monitors of exactly the same pixel density and dimensions I appear to have no recourse. – BrettRobi Jul 12 '10 at 22:55
  • Maybe it's painfully obvious, but you need to rename the rdp file to a txt. – MathewC Jun 30 '15 at 15:23
  • That's a fair point, it's not clear from my answer that RDP files are text format files that can be edited in a text editor. – Helvick Jul 01 '15 at 15:56
4

I was trying to fix this same issue myself today and kept finding variations of these directions but could not get them to work. For anyone else that has been having difficulty with the 'Winposstr' solution I found a much simpler work around that has given me zero issues so far and accomplishes the same thing. I am using Windows 10.

span monitors:i:1
multimon:i:1
selectedmonitors:s:0,1,2

Look for or add the 'selectedmonitors:s:' line to your RDP configuration file and simply enter the primary display first.

To get your monitor's display # open a command prompt and run the command "mstsc /l". This will return a window listing your monitor ID #'s and positions - Note that these will not be the same numbers you see in your display settings.

In my case I have three monitors and received back:

0: 1024  x 768; (-1024, 11, -1, 778)
1: 1920 x 1080; (2560, 11, 4479, 1090)
2: 2560 x 1440; (0, 0, 2559, 1439)

Since I only want to use two specific monitors for this particular connection (0 and 2), and I want monitor '2' to be the primary monitor my configuration now shows:

selectedmonitors:s:2,0
Taylor S
  • 41
  • 1
4

Analyzing the .rdp File

The .rdp file contents will look like this:

screen mode id:i:2
use multimon:i:0
desktopwidth:i:1680
desktopheight:i:1050
session bpp:i:32
winposstr:s:0,1,-1680,0,-115,1050
[….]

Look for the keyword winposstr. The most important parameters are the numbers after winposstr. Ignore the initial ":s:0,1," and focus on the last four comma-delimited numbers.

The last four numbers express, in pixels, the position of the left, top, right, and bottom edges of the remote session window.

The numbers actually refer to the window position when the window is restored, but the pixel position of the left edge of the window is important because it also determines the monitor that the remote session will use when the window is maximized.

Calculating the Values for winposstr

The numbers that you will use depend on how many monitors you have, the screen resolutions of each, and which monitor you have selected to be your primary monitor.

Left edge position determines the monitor

The first of the last four numbers, which is the most important, indicates the position of the left edge of the window. If your primary monitor is in the center and you have monitors to the left and right, you will use a negative number for the monitors to the left, and a positive number for the monitors to the right.

For example, if you have two monitors to the left that each have a resolution of 1680 x 1050, use -1680 to place the session window on the monitor to the immediate left, and double that (-3360) to place the window on the leftmost monitor.

winposstr:s:0,1,**-1680**,0,0,1050

winposstr:s:0,1,**-3360**,0,-1680,1050

If your primary monitor has a resolution of 1200 x 1920, use 1200 to place the window on the monitor on the immediate right. This works because that pixel position is where the primary monitor leaves off (and the monitor on the right begins).

winposstr:s:0,1,**1200**,0,2880,1050

If you have two monitors on the right with a resolution of 1680 x 1050, and want to place the window on the rightmost monitor, simply add 1200 to 1680 to get 2880.

winposstr:s:0,1,**2880**,0,4560,1050

Top and Bottom Edges The other numbers only really come into play when the window is restored (not maximized) and can be adjusted to taste.

The second number (third from the end) indicates the topmost edge of the window, so you can leave this number at 0 unless you have special requirements. The fourth (last) number is the vertical resolution (=bottom) of the window. You can leave this at the maximum vertical resolution of the monitor, as in the examples above.

winposstr:s:0,1,1200,**0**, 2880,**1050**

Right Edge The right edge of the window is expressed by the next to the last number. Unless you prefer otherwise, this can be set to the same size as the maximized window. Following the monitor resolution examples above, here are the calculations:

Monitor Right Edge Calculation      Winposstr Value
Leftmost    -3360 + 1680 = -1680    winposstr:s:0,1,-3360,0,**-1680**,1050
Immediate left  -1680 + 1680 = 0    winposstr:s:0,1,-1680,0,**0**,1050
Immediate right 1200 + 1680 = 2880  winposstr:s:0,1,1200,0,**2880**,1050
Rightmost   1200 + 1680 + 1680 = 4560   winposstr:s:0,1,2880,0,**4560**,1050
DATEx2
  • 175
  • 3
  • 2
    This is the correct answer. This is how you can specify which monitor to open in. The procedure feels like kind of a hack, but it works! – awe Jun 08 '15 at 11:12
0

The answers which use the screen coordinates are fiddly to implement and don't work well if you change between different screen setups frequently (e.g. hotdesking or hybrid working) or if you want to share the RDP file with others.

The settings below from Scott Hanselman's blog worked well for me:

screen mode id:i:2
span monitors:i:1
use multimon:i:1
selectedmonitors:s:1,2

The final line is the only one that needs tailoring to your situation. I have 3 screens and from running "mstsc /l" in the run menu, I can see that it numbers them 0,1,2 from left to right, so I can choose between these options:

selectedmonitors:s:0,1 //first 2 screens
selectedmonitors:s:1,2 //last 2 screens
selectedmonitors:s:0,1,2 //all 3 screens
selectedmonitors:s:0 // first screen only
selectedmonitors:s:1 // second screen only
selectedmonitors:s:2 // third screen only
selectedmonitors:s:0,2 //this doesn't work so just does second screen
sahmeepee
  • 146
  • 3