when you invoke :
ProcessStartInfo startInfo = new ProcessStartInfo("someExecutable.exe");
Does this actually run the someExecutable.exe
or does it just monitor that? I am essentially seeing if this can be used to read output from an already running exe or if it will call the exe.
I am trying to find a way to just monitor and record a few values from an already running exe.
The answer is neither ... nor! The MSDN article about the ProcessStartInfo states:
and also
Using the ProcessStartInfo class you can neither start, nor monitor a process.
However depending on what you need to monitor (for example the output of the executable) you can use the ProcessStartInfo class to redirect the ouput of the process you are going to start programmatically. In order to do that you need to set the RedirectStandardOutput property of the ProcessStartInfo class. So you need the class in order to allow/configure process monitoring assuming you will start the process programmatically.
The commented MSDN example to clarify my answer: