是否可以启动远程应用程序并使其在 Windows 中交互式显示?

发布于 2024-11-26 23:45:58 字数 1084 浏览 1 评论 0原文

我确信以前已经有人问过这个问题,但我还没有找到问题或答案。

我有一个自定义选项卡式应用程序,它在每个选项卡上显示来自各种科学仪器的数据。我的用户希望单击一个选项卡,并在单击我的应用程序中的选项卡时让我的应用程序在另一台计算机上启动各种仪器控制器应用程序(或将其带到前台)。

我尝试了很多不同的方法,从编写自己的 C# 应用程序来执行 Process.Start,编写位于远程计算机上的第二个 C# 应用程序并启动适当的应用程序,使用 Sysinternals 的 psexec 等。我可以得到在远程计算机上成功启动的过程,但无论我提供哪个用户的凭据(并且无论用户是否以交互方式登录),GUI 都会丢失。我相信这是 Windows 中的安全增强功能。

查看 Win32_Process MSDN 的 Create() 方法文档揭示了我的怀疑 - 出于安全原因,Win32_Process.Create 方法不能用于远程启动交互式进程。

看来我能做的最好的就是远程访问任务计划程序以在一段时间间隔后启动远程应用程序。我确信这会给我的应用程序带来可怕的用户体验(谁想单击选项卡并等待 30 秒?),因此我避免使用这种方法。

有人可以提出一种可行的方法,或者帮助反驳这样做的可能性吗?

编辑 psexec自己的文档证实了我的观点:不可能。 -x 标志表示“在 Winlogon 桌面上显示 UI(仅限本地系统)”。如果可能的话,我确信 Sysinternals 会让这一切发生。

I am sure this has been asked before, but I have yet to find the question or answer.

I have a custom tabbed application that displays data from various scientific instruments on each tab. My users want to click a tab and have my application start various instrument controller applications (or have it brought to the foreground) on another machine when a tab is clicked in my application.

I've experimented with lots of different approaches, from writing my own C# app to do Process.Start, writing a 2nd C# app that lives on the remote machine and kicks off the appropriate app, using Sysinternals' psexec, etc. I can get the process to start successfully on the remote machine, but the GUI is missing no matter which user's credentials I supply (and regardless of whether a user is logged on interactively.) I believe this is a security enhancement in Windows.

Looking at the Create() method of the Win32_Process MSDN documentation reveals what I suspected - For security reasons the Win32_Process.Create method cannot be used to start an interactive process remotely.

It looks like the best I can do is remotely access Task Scheduler to kick off the remote application after some time interval. I'm sure this would bring a horrible user experience to my app (who wants to click a tab and wait 30 seconds?) so I am avoiding that approach.

Can someone suggest an approach that will work, or help disprove the possibility of doing this?

EDIT psexec's own documentation bears out my contention that it's not possible. The -x flag says "Display the UI on the Winlogon desktop (local system only)." If it were possible I'm sure that Sysinternals would have made it happen.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

死开点丶别碍眼 2024-12-03 23:45:58

在远程计算机上有一个正常的交互式进程来侦听命令。然后,您可以向其发送命令来运行适当的进程。您可以这样做:

  1. 将您的进程放在“开始”菜单(或注册表的 HKLM/HKCU Run 部分)中用户的“启动”组中。
  2. 然后,只要用户登录,您的进程就会以交互方式运行。您可以创建一个托盘图标来指示它正在运行。
  3. 您的进程打开一个 TCP 端口来侦听命令。
  4. 另一台计算机上的控制进程向 TCP 端口发送命令。
  5. 您的进程运行指定的命令。由于您的进程以交互方式运行,因此子进程也将是交互的。

TCP 端口将成为一个巨大的安全漏洞。根据您的需要尽可能多或尽可能少地保护它。

Have a normal, interactive process on the remote computer that listens for commands. You can then send it a command to run the appropriate process. You might do it like this:

  1. Place your process in the user's Startup group in the Start menu (or HKLM/HKCU Run section of registry).
  2. Your process will then run interactively whenever a user logs in. You could create a tray icon to indicate that it's running.
  3. Your process opens a TCP port to listen for commands.
  4. The controlling process on another computer sends a command to the TCP port.
  5. Your process runs the specified command. Because your process ran interactively, the child process will be interactive too.

The TCP port will be a gaping security hole. Secure it as much or as little as you need.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文