Is my process waiting for input?

Depending on what the 3rd party process is doing exactly you could try polling its threads’ states: foreach(ProcessThread thread in process.Threads) if (thread.ThreadState == ThreadState.Wait && thread.WaitReason == ThreadWaitReason.UserRequest) process.Kill(); Failing that… you can try to process.StandardInput.Close(); after calling Start(), I conjecture that an exception will be raised in the child process if it’s trying … Read more

Using PerformanceCounter to track memory and CPU usage per process?

For per process data: Process p = /*get the desired process here*/; PerformanceCounter ramCounter = new PerformanceCounter(“Process”, “Working Set”, p.ProcessName); PerformanceCounter cpuCounter = new PerformanceCounter(“Process”, “% Processor Time”, p.ProcessName); while (true) { Thread.Sleep(500); double ram = ramCounter.NextValue(); double cpu = cpuCounter.NextValue(); Console.WriteLine(“RAM: “+(ram/1024/1024)+” MB; CPU: “+(cpu)+” %”); } Performance counter also has other counters than … Read more

Why is this process crashing as soon as it is launched?

I ended up opening a case with Microsoft, and this is the information I was given: Process.Start internally calls CreateProcessWithLogonW(CPLW) when credentials are specified. CreateProcessWithLogonW cannot be called from a Windows Service Environment (such as an IIS WCF service). It can only be called from an Interactive Process (an application launched by a user who … Read more