title: start and close instance of explorer.exe
body: <p>I have a strange behaviour when I try to start explorer.exe from c# like this:</p>
  
  <pre><code>ProcessStartInfo info = new ProcessStartInfo("explorer.exe", "E:");
  info.WindowStyle = ProcessWindowStyle.Hidden;
  Process process = new Process();
  process.StartInfo = info;
  process.Start();
  Thread.Sleep(2000);
  bool res = process.CloseMainWindow(); // InvalidOperationException -&gt; already exited
  process.Close();
  process.WaitForExit(5000);
  </code></pre>
  
  <p>The problem is:</p>
  
  <p>the exception seems correct, because at this point <code>HasExited</code> returns already <code>true</code>. Nevertheless in the taskmanager the created instance of explorer is still present.</p>
  
  <p>So I dont understand what my call does. I had thought it would directly start an instance of explorer, but it seems not or the explorer works in some different way.</p>
  
  <p>And my second question: how can I start and shortly after that stop a new specific instance of explorer programmatically?</p>
  
  <p><strong>Edit</strong>
  to answer some questions:</p>
  
  <ul>
  <li>explorer option <code>Launch Folder Windows in a separate process</code> is set to true</li>
  <li>the created <code>process.Id</code> is not present in taskmanager. For example: the new explorer instance shown in taskmanager has PID 4968 while the debugger shows 10752 as ID of the created (and exited) process.</li>
  </ul>
  
  <p><strong>Edit:</strong> here a screenshot from taskmanager after ~12 debug runs
  <a href="https://i.stack.imgur.com/NurRs.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NurRs.png" alt="enter image description here"></a></p>