How do I configure a Remote Desktop Connection shortcut to open on a specific monitor?


A customer wanted to know how to configure a Remote Desktop Connection shortcut so that the session appears on the monitor of choice. "I have two RDP shortcuts, and each one displays on a different monitor, but I want them all to display on my 20-inch monitor. How do I tell the bad shortcut, 'Hey, use that monitor over there please'?"

Normal shell shortcuts (LNK files) do not encode monitor information. It is up to the application to decide where to display its windows. Many applications save the window position when you exit and restore it when you restart. If you have one of these types of programs, then the solution is simple: Move the window to where you want its position to be remembered, and then close it.

In the case of RDP files, the window position is stored in the RDP file settings. The Terminal Services Team Blog tells you how.

One thing I found interesting about that blog entry is that none of the comments is on topic. Well, okay maybe two of them.

Comments (21)
  1. Dan Bugglin says:

    Some applications also display windows on the current monitor the cursor is on, or the current monitor the active window is on.  IIRC the MessageBox API uses one of the two, though you might have to pass in NULL for the parent window for that behavior.

  2. nathan_works says:

    The comments are on topic, just not the topic of the blog post..  Would seem like the comments go great with a different post.

  3. Michiel says:

    ARe they really off-topic? I can't really tell. I see lots of messages on the topic of certain NVidia-based computers computers which have an RDP problem. That's possibly ontopic, as NVidia would be responsible for multi-monitor support.

  4. The comments are on topic, just not the topic of the blog post

    Right – clearly it's the blog post which is offtopic. They should have taken it elsewhere :P.

  5. Falcon says:

    To add to what Nathan_works said:

    Are you sure the comments are off-topic? Maybe the blog post itself is off-topic instead?

    It's all relative!

  6. Tom says:

    People "in the know" often take their support questions to unrelated blog posts because they can get direct access to the dev team.  Something that takes you multiple levels of escalation to get from PSS.

  7. James Schend says:

    Maybe they need a guy who the social skills of a thermonuclear device to moderate comments.

  8. Relative URLs says:

    BTW, trying to reach this page from an RSS-reader doesn't work, because the RSS feed has relative instead of absolute URLs in the <link rel="alternate"> elements.

    Standard disclaimers about Microsoft applies.

  9. Ben Voigt says:

    Since shortcuts do control the wShowWindow variable in the STARTUPINFO structure (msdn.microsoft.com/…/ms686331(v=VS.85).aspx), it isn't unreasonable to surmise that they might be able to set dwX, dwY, dwXSize, and dwYSize as well.

  10. Nawak says:

    Many applications save the window position when you exit and restore it when you restart

    Yes, but wouldn't that behaviour make the two instances of the application open in the same spot? It works if it's two different apps that you want on two different monitors though…

    In this customer's case, that's what he would have wanted, so the position saving would have been enough, except that the application knew better and finally "auto-arranged" its instances relative to each other.

    it isn't unreasonable to surmise that they might be able to set dwX, dwY, dwXSize, and dwYSize as well.

    Well, yes, at least if the application uses "CW_USEDEFAULT" for its main window. Splash windows usually are software centered and doesn't use the defaults, so the setting specified in the shortcut could "wait" until the main window appears.

    Anyway, I'm sure there's plenty of reasons why it wouldn't work or why it is on the bottom of THE todo list, but this blog entry at least shows how windows works now and how these kind of problems can be solved by applications right now.

  11. arnshea says:

    The RDP client I've been using on XP seems to always start and restore the window to the "primary" monitor.  I figured it was just an oversight since imho most programs don't do multi-monitor support all that well (e.g., the file open dialog opening on the primary monitor even if the main app window is on a second or third monitor).

    I can't think of good defaults for all situations though it would be nice if any owned windows were displayed, by default, on the same monitor as the owning window.  OTOH, if dialogs remember their last position and that happens to be on a different monitor, where should they show up?

  12. Scott says:

    BTW, trying to reach this page from an RSS-reader doesn't work, because the RSS feed has relative instead of absolute URLs in the <link rel="alternate"> elements.

    Standard disclaimers about Microsoft applies.

    You mean Microsoft following standards that allow relative URLs and most RSS/ATOM readers can handle without any problems?

  13. Mott555 says:

    The way some applications remember the last window location can be a problem. I had a piece of software–can't remember what, this was several years ago–that worked that way, and I momentarily had dual monitors since my sister's computer was dead at the time and I borrowed her monitor just to experiment with dual screens. At some point I had dragged the window to the secondary screen. Eventually she got her computer fixed and I had to return her monitor. But this application would continue to happily open where it was before–on a screen that was no longer there. I didn't have the install CD for the program at my current residence so I couldn't reinstall it to fix it, and everybody I lived with only had laptop PCs so I couldn't borrow one of their screens. As I remember it was several weeks or maybe a couple months until I got a hold of a second screen just so I could drag the window back to my primary screen.

    [Now all I have to do is send the article How do I get a window back on the screen when it moved far, far away? into a time machine for you. -Raymond]
  14. Bill says:

    @Mott: To get windows back from non-existent monitors:

    Select the missing window in the taskbar.

    Press Alt+Space.

    Select Move. (M)

    Use arrow keys to restore window to correct monitor.

    Profit!

  15. jttalley42 says:

    For windows stranded on monitors that are no longer available, I find that it usually works to use the keyboard shortcuts for the system menu.  ALT-Space for the menu, then M for Move, then arrow keys to slide the window onto the monitor you have, then Enter to stop moving when you can see at leasst part of the window.

  16. Nick says:

    "One thing I found interesting about that blog entry is that none of the comments is on topic."

    And here I thought you'd be used to that, Raymond ;)

    @arnshea

    I have no problems with the XP RDP client remembering which monitor I had it on.  I always use my secondary monitor for RDP sessions and that's where it always opens.  FYI:

    C:>filever c:windowssystem32mstsc.exe

    –a– W32i   APP ENU  6.0.6001.18000 shp    677,888 04-13-2008 mstsc.exe

  17. GregM says:

    Bill and JT, it's even easier than that.  From Raymond's linked post above:

    "Type M to select Move, then press an arrow key to enter Move mode. (Doesn't matter which.)

    At this point, you could stick with the keyboard motif and hold down the appropriate arrow key to move the window back onto the screen. Or you can pull a little magic trick: Wave the mouse around. Boom, the window leaps to the mouse like one of those cheapo magic tricks where something leaps into your hand."

    This trick works even when you don't know where the window is, so you don't know which arrow keys you need to use to move it back to where it's visible.

  18. John Muller says:

    Coincidently, today I'm starting work on testing behavior of an SDK on multiple monitors, however the monitor selection depends on specific hardware capabilities, so it's a special case.

    Fortunetly, I also just got a second monitor today (with the special hardware). I'll have to check out what happens if the hardware is installed, but the app is run within a Remote Desktop session.

    Definetly a better situation than the time I was supposed to test if an major update to an operating system properly detects/reports more than 4GB of ram on 64 bit, when I only had machines with 2GB (and even swapping ram around could only get me to 4GB, not over it)

    Sadly, even the Virtual Machine software available wouldn't let me create a VM with more RAM than physically available.

  19. Worf says:

    Funny thing with RDP – if it doesn't work, try updating your display driver. Yes, update the display driver. Oddball, but it seemed one Microsoft update broke RDP for me, and a video driver update fixed it.

    Still run into the problem around the office…

  20. Mike Dimmick says:

    @Nick: You have XP SP3 which includes Windows Vista SP1's version of Remote Desktop Client. This is the version which infamously silently ignores the /console switch that all previous versions have supported and requires you to supply /admin to get the same behaviour.

    Support nightmare if you have an interactive service that only manages to slap its icon onto the console session's taskbar. I know, I know, but I've not had time to fix this yet.

  21. Nick says:

    @Mike:

    Yep — and let me tell you, when I found out that the reason I wasted an hour trying to figure out why /console I was less than pleased with whichever bozo at Microsoft modified that application.  Complete case of 100% extra large grade AAA USDA certified FAIL.

    There were dozens of alternatives available, all better than silently ignoring the option.

Comments are closed.