I am trying to launch a GUI application remotely using PsExec.
ProcessStartInfo info = new ProcessStartInfo(@"<path to dir>");
info.FileName = @"C:\<dirpath>\PsExec.exe";
info.Arguments = @"\\" + "<COmputerName>" + " " + @"""C:\Program Files (x86)\<exepath>\<exename>.exe""";
info.RedirectStandardOutput = true;
info.UseShellExecute = false;
info.RedirectStandardError = true;
info.WindowStyle = ProcessWindowStyle.Maximized;
Process o = Process.Start(info);
The issue here is that the process does launch remotely, but I cannot see the GUI. I can only see it in task manager. Is there a way to see the GUI on the remote computer?
EDIT 1: *Permissions*
If I execute above lines of code before starting process, it gives:
*InteractiveMode* When I try to use the switch -i from the cmd prompt it gives: Process exited with error code -1073741502. While trying to execute using C#, it doesnt do anything at all. No exception at least!
END OF EDIT 1.
Assuming correct permissions you want -i
for interactive mode.
-i Run the program so that it interacts with the desktop of the specified session on the remote system. If no session is specified the process runs in the console session.
info.Arguments = @"\\" + "<COmputerName>" + " -i " + @"""C:\Program F...