Process p = new Process();
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.CreateNoWindow = true;
p.StartInfo.FileName = @"PsExec.exe";
p.StartInfo.Arguments = @"\\10.10.1.127 -accepteula -i -u administrator -p 1 -n 10 c:\myapp.exe";
p.Start();
How can I determine whether p.ExitCode
is the code coming from PsExec
or myapp.exe
?