none
PSExec Spawns Processes but Hangs in C# program RRS feed

  • Question

  • using (PowerShell ps = PowerShell.Create())
                        {
                            ps.AddCommand(Path.GetDirectoryName(Application.ExecutablePath) + @"\PsExec.exe");
                            ps.AddParameter(@"\\" + computer + " -h -u " + username + " -p " + password + @" \\" + computer + @"\c$\temp\" + filename + " /v" + "\"" + txtArguements.Text + "\"" + "| out-null");
    Collection <PSObject> PSOutput = ps.Invoke();
    }

    I am having troubles getting the above c# program to install software on a remote system. The txtArguements.text is equal to "/qn SHOWACTIVATE=0" (these are the arguments for the program I am installing) the PSExec launches the process on the remote system, but it just sits there forever and never installing anything. Yet when I put the exact same command into Powershell, it works just fine. Any ideas?

    Friday, November 2, 2018 10:26 PM