title: Check if an executable exists in the Windows path
body: <p>If I run a process with <code>ShellExecute</code> (or in .net with <code>System.Diagnostics.Process.Start()</code>) the filename process to start doesn't need to be a full path.</p>
  
  <p>If I want to start notepad, I can use</p>
  
  <pre><code>Process.Start("notepad.exe");
  </code></pre>
  
  <p>instead of</p>
  
  <pre><code>Process.Start(@"c:\windows\system32\notepad.exe");
  </code></pre>
  
  <p>because the direcotry <code>c:\windows\system32</code> is part of the PATH environment variable.</p>
  
  <p>how can I check if a file exists on the PATH without executing the process and without parsing the PATH variable?</p>
  
  <pre><code>System.IO.File.Exists("notepad.exe"); // returns false
  (new System.IO.FileInfo("notepad.exe")).Exists; // returns false
  </code></pre>
  
  <p>but I need something like this:</p>
  
  <pre><code>System.IO.File.ExistsOnPath("notepad.exe"); // should return true
  </code></pre>
  
  <p>and</p>
  
  <pre><code>System.IO.File.GetFullPath("notepad.exe"); // (like unix which cmd) should return
                                             // c:\windows\system32\notepad.exe
  </code></pre>
  
  <p>Is there a predefined class to do this task available in the BCL?</p>