Reputation: 427
I am using this code to open process in remote machine:
Process process = new Process();
ProcessStartInfo psi = new ProcessStartInfo(@"D:\tools\PsExec\PsExec.exe");
psi.UseShellExecute = false;
psi.RedirectStandardOutput = true;
psi.RedirectStandardError = true;
psi.RedirectStandardInput = true;
psi.WindowStyle = ProcessWindowStyle.Minimized;
psi.CreateNoWindow = true;
psi.Arguments = "\\\\192.168.0.100 -u user-p pass D:\\app.exe";
process.StartInfo = psi;
process.Start();
on the remote machine i can see that the process start but i cannot see my Application GUI
.
Double click on the exe will open the GUI
Upvotes: 4
Views: 9103
Reputation: 31
You must to specify the -i parameter with the current userID by default it is 0, in order to get the current logged user ID use: quser /SERVER:remoteComputer , in my case it returned 2, so, it is : -i 2 I hope it works for you.
Upvotes: 3
Reputation: 3489
Try using psexec.exe
with the -i
switch :
psi.Arguments = "\\\\192.168.0.100 -i -u user -p pass D:\\app.exe";
or
psi.Arguments = "\\\\192.168.0.100 -i 0 -u user -p pass D:\\app.exe";
use 1 instead of 0 if you are using vista or higher. User desktop runs in session 1 in vista or higher.
Upvotes: 5