.netremote-processwaitforexit

Wait for a remote process to finish in .net


We all know and love Process.WaitForExit().

Given a pid of a process on a remote machine (created by WMI/psexec), how do I wait for it to end?


Solution

  • Process.GetProcessById(processId, machineName).WaitForExit();