-
-
Notifications
You must be signed in to change notification settings - Fork 475
[Protocol] RDP in mstsc.exe mode
In this mode, rdp session will be start by run command mstsc.exe xxxx.rdp
in cmd.
When our user using 2 monitors with different scale ratios and wants to go to full-all-screens, we didn't find a solution to handle this 2 different scale ratios on Remote Desktop ActiveX control, and found that only mstsc.exe can do this.
Then we make PRemoteM check user's monitor resolution and scale ratios before a multi-monitors full-screen rdp session start. If we found 2 monitors with different scale ratios, a temp file 'xxxx.rdp' will be created and PRemoteM will call cmd command mstsc.exe xxxx.rdp
to start the session.
In the process of development, we found it in the .rdp
file there are many settings that Remote Desktop ActiveX control can't access.
such as:
setting | description |
---|---|
selectedmonitors:s:0,2 | When you connect 3 monitors, the setting allow you only uses the No. 0, 2 display to display the remote desktop. The No.1 display will continue to display your local desktop. cmd mstsc /l can see the number of the monitors |
redirectcomports:i:1 | Redirect the COM port of the local machine to the remote session. |
desktopwidth:i:800 | Specifies the resolution width (in pixels) of the remote session to 800pix. |
desktopheight:i:600 | Specifies the resolution height (in pixels) of the remote session to 600pix. |
in PRemoteM :
more settings:
在该模式下本程序将以命令行 mstsc.exe xxxx.rdp
的形式启动 rdp 远程会话
我们发现当用户的主机存在两台缩放率不一致的显示器时,微软官方远程桌面控件 Remote Desktop ActiveX control 将无法使用正确的缩放率全屏显示远程会话。但系统自带的 mstsc.exe 程序却可以做到这一点。
因此 PRemoteM 在启动多显示器全屏 rdp 会话前,会检查客户端连接的显示器,若缩放率不一致,则会以命令行 mstsc.exe xxxx.rdp
的形式启动该 rdp 会话。
在开发迭代的过程中,我们发现 .rdp
文件中有很多 Remote Desktop ActiveX control 无法控制的指令。
例如:
命令 | 作用 |
---|---|
selectedmonitors:s:0,2 | 当你外接了 3 台显示器,该指令允许你只使用其中的 0、2 号显示器显示远程桌面,1 号显示器将继续显示你本机的桌,显示器编号看通过指令 mstsc /l 查看 |
redirectcomports:i:1 | 将本地机器的 COM 口重定向到远程会话中 |
desktopwidth:i:800 | 设置窗口宽度为 800pix |
desktopheight:i:600 | 设置窗口宽度为 600pix |
在 PRemoteM 中填写为:
更多指令可参考: