开发者

Is it possible to launch a remote app and have it displayed interactively in Windows?

开发者 https://www.devze.com 2023-03-24 06:55 出处:网络
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 wa

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开发者_C百科 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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消