Duplicate of this question.
update - This is not an exact duplicate. See my solution.
I see a java.exe process in process explorer, and double clicking it gives me its working directory & starting command line arguments.
From .NET, I run the following code and get a process with the same PID but the above fields are empty. Apparently, this is documented.
foreach (Process process in Process.GetProcessesByName("java"))
{
...
}
So how do I get the correct startinfo field values, without peeking into process memory by hand (in other words - I'd like to steal this code from somewhere instead of hack the process memory myself).