I'm coding a watchdog service for an embedded system that monitors some proprietary processes and restarts them if necessary. (Nothing to do with *malware*, before you ask. It's just a business requirement)

I need to **retrieve the friendly name from a process I have just created**, so that later I can retrieve that process using that name in order to monitor its health.

My problem is as follows:

* If I try to read `Process.ProcessName` right after `Process.Start()`, I get an `InvalidOperationException` because it the process has not been fully created yet.
* The same happens if I use `Process.WaitForInputIdle()`, but since this requires a message pump and many executables could be UI-less launchers for the actual application, this might not be an option.
* I **need** to get the friendly name right after creating the process, before doing anything else.

Here's a code snippet:

```
var startInfo = new ProcessStartInfo { FileName = "notepad.exe" };
var process = new Process();
process.StartInfo = startInfo;
process.Start();
process.WaitForInputIdle();
var friendlyName = process.ProcessName;

```

This will throw an `InvalidOperationException` on the last line if the process being started is Firefox, for example.

So how would I do this? Is there a safer method? 

EDIT: Added a code snippet for clarification.
EDIT2: Rephrased the whole question for clarification, left irrelevant stuff out.