Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PsExec open my remote machine process but application didn't start

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

enter image description here

like image 995
user1860934 Avatar asked Feb 14 '23 20:02

user1860934


1 Answers

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.

like image 104
jester Avatar answered Mar 08 '23 23:03

jester