1

Context: All I want to do is, start a GUI application (ex: mspaint) on Windows node (spawned on cloud) using Java and when I connect using RDP, I want the GUI application to be already there.

Issue: After connecting to the remote Windows node through RDP, I don't see the GUI application already there. I can see that my Java program has actually started GUI application and I can see that in the tasks list. It got started under "Services" session. When I run the same Java program after connecting to RDP, it started the same application in session with name "RDP-Tcp#0"

If I am using traditional RDP client, I can simply choose the session I want to connect to but here I have no control as I am using HTML5 RDP client called Guacamole.

Java program uses Runtime.getRuntime().exec() API to run a powershell script thats starts the GUI application.

Is there a way to run my script so that it runs and shows the GUI on a different session? This is trivial in Linux where we need to simply export the DISPLAY env variable.

Please help

4

1 回答 1

1

您无法在尚不存在的 RDP 会话中启动程序。要获得您想要的工作,您需要您的代码通过 RDP 实际登录,启动程序,然后在不注销的情况下断开会话。但是,由于空闲会话会占用系统资源,终端服务器管理员倾向于为空闲会话设置超时,之后用户会自动注销。

于 2013-07-31T17:25:17.293 回答