tags:

views:

732

answers:

4
+2  A: 

You are getting a different Process instance back from GetProcessesByName that falls into the latter case of the statement on MSDN.

leppie
+2  A: 

You are still doing a GetProcess, thus it continues to work the same. The fact that you started it doesn't make a difference.

Process.Start(...) returns the process that you started. I expect that if you check the StartInfo property on that, it will be populated.

Rob Prouse
A: 

Ugh, that is frustrating. I think they could probably make that documentation a little clearer as it's easy to read that as "if you do use Process.Start then that information will be available".

Guess I'll have to use WMI after all, ah well.

Sean Gough
A: 

Process.StartInfo appears to be empty always!!!

I got entire running process list and try to dump values in StartInfo, but all 100+ processes' StartInfo fields are empty.

From MSDN:

"If you did not use the Start method to start a process, the StartInfo property does not reflect the parameters used to start the process. For example, if you use GetProcesses to get an array of processes running on the computer, the StartInfo property of each Process does not contain the original file name or arguments used to start the process."

You'll have use WMI to get that info for now.