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.
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:
The TCP port will be a gaping security hole. Secure it as much or as little as you need.