Getting RDP to honor width and height parameters?
I have checked this question but my situation is slightly different.
I have a work computer with 2 monitors, each running at 1650x1050. I have a 3 monitor setup at home. Both systems run Windows 7. All three monitors on the home system run at 1920x1080 with one monitor setup individually and the other two configured as a single 3840x1080 monitor. I'd like to have my RDP session run on the one 3840x1080 monitor, but there's a problem.
I've configured my home computer's RDP session for work to run at 3840x1080:
mstsc.exe default.rdp /w:3840 /h:1080
This works about half the time. The other half, the remote window comes up at a resolution of 4096x1080 (I think this is probably the default "maximum" resolution or something.)
It seems to have something to do with whether the session starts up on my one "single" monitor or my other "dual" monitor. Unfortunately, I have the "single" monitor set up as my "main" display in Windows so that's where it wants to start. I have to futz around with the position of the desktop shortcut and move the login window to the other monitor, and still it only works about half the time.
Does anybody have a way to either (1) get RDP to forcibly accept this 3840x1080 resolution or (2) force it to start up on the secondary monitor?
Solution 1:
You can do it through tweaking the values of winposstr
inside the rdp file itself. Here is a detailed explaination
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.
╔══════════════════╦════════════════════════════╦════════════════════════════════════╗ ║ 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 ║ ╚══════════════════╩════════════════════════════╩════════════════════════════════════╝