How to start process /instance with a custom identifier
<p>I have to start several instances of the application and I have to identify it later somehow.</p>

<p>Is it possible to start instance with some custom <strong>TAG</strong> so later I can find the instance I need? </p>

<pre><code>Process p = new Process();
// p.TAG = "Guid"; ??????
p.StartInfo.FileName =  "path";
p.Start();
</code></pre>

<p><strong>UPDATE 1</strong></p>

<p>I start several processes in the LOAD event of WPF app. And sometimes cannot get process Id of the current app. So I am looking for approach to differentiate an instance in some custom way if it is possible...</p>

<p>So the model looks like</p>

<pre><code>ParentApp.exe
    ----&gt;  Sun.exe
    ----&gt;  Moon.exe


ParentApp.exe
    ----&gt;  Sun.exe
    ----&gt;  Moon.exe
</code></pre>

<p>And I use <code>LOAD</code> event of ParentApp.exe to pass to Sun.exe and Moon.exe correct Process ID so later they can able create correct MSMQ  and exchange data with ParentApp.exe and also ParentApp.exe could close those apps.</p>

<p><strong>UPDATE 2</strong></p>

<p>May we keep some custom data during application executing here</p>

<pre><code>p.Domain = "mydomain?????";
p.EnvironmentVariables.Add("MY_NEW_VARIABLE", "SOME_TEXT????");
</code></pre>

<p><a href="http://blog.gapotchenko.com/eazfuscator.net/reading-environment-variables" rel="nofollow">http://blog.gapotchenko.com/eazfuscator.net/reading-environment-variables</a></p>