MSTSC set to full screen on second monitor

0

I have a laptop with an attached display , so I have two monitors. I want to set my MSTSC client session to the size of my secondary monitor - however I travel between offices a lot and so the second screen changes in size - Setting the client settings to FULL sets it to the size of my primary monitor as mentioned here . Swapping my primary to the attached display wont work as then all the icons would be covered by the MSTSC session.

I want this as when the MSTSC is full screen on the second screen it captures the special keys ALT-TAB etc, but I can still just click on the applications on the main screen Currently I have a number of different saved RDP files - one for each possible resolution. But I sometimes cant guess the correct size.

I can probably write a script for this - has anyone done this? Or even written a script which determines if there is a secondary screen and what resolution the two screens are? Powershell would be best then VBScript.

This question is similar to [this](How to use RDMan with multiple monitors and scaling to be full screen when client display is larger than host display?) but I want to use MSTSC due to the alt-tab feature which I don't think works with RDPMan.

Thanks

Ross

Posted 2017-05-09T22:39:42.483

Reputation: 1 096

Answers

0

In the end I found a few articles and wrote the following Powershell script - You give it the name of the server - which must be an already existing saved RDP file

$RDPFile=$Args[0]

Add-Type -AssemblyName System.Windows.Forms
$Screens = [System.Windows.Forms.Screen]::AllScreens 
# Look for a non-primary screen - @todo - what if I have three screens?
$Screen = $Screens | where-object {$_.Primary -eq $FALSE}[0]
# If we dont have a screen which is not a Primary then use the primary    
if ($Screen -eq $Null) { 
  $Screen = $Screens | where-object {$_.Primary -eq $TRUE}[0]
}
# Now connect using an RDP file - but set the width and height and full screen mode
 mstsc.exe E:\cmds\RDP\$($RDPFILE).RDP /f /w:$($Screen.Bounds.Width) /h:$($Screen.Bounds.Height) 

Ross

Posted 2017-05-09T22:39:42.483

Reputation: 1 096