C# get info about a Windows process after it was finished

64 views Asked by At

For a long time, I've been looking for a way to get info about a Windows process which has been finished having only its PID.

Does anybody know if it's possible at all? If yes, then how I can do it?

Many thanks.

1

There are 1 answers

3
McNets On

You can use Process.GetProcessById(Int32). But according to docs you should get a ArgumentException if the process is not running.

Quoted from docs:

Exceptions

ArgumentException

The process specified by the processId parameter is not running. The identifier might be expired.