title: "File not found" error launching system32\winsat.exe using Process.Start()
body: <p>I'm trying to run the <a href="http://msdn.microsoft.com/library/windows/desktop/cc948912.aspx" rel="nofollow">Windows System Assessment Tool</a> (winsat.exe) using the following code:</p>
  
  <pre><code>System.Diagnostics.Process WinSPro =
      new System.Diagnostics.Process();
  System.Diagnostics.ProcessStartInfo WinSSInfo = 
      new System.Diagnostics.ProcessStartInfo();
  WinSSInfo.FileName = "cmd.exe";
  WinSSInfo.Arguments = "/k winsat.exe";
  WinSPro.StartInfo = WinSSInfo;
  WinSPro.Start();
  </code></pre>
  
  <p>This code works if I only call cmd.exe, and even if I call regedit.exe it still works.
  However, when I try to call winsat.exe as a argument of cmd.exe, it fails.
  The command prompt shows this:</p>
  
  <pre>
  'winsat.exe' is not recognized as an internal or external command, 
  operable program or batch file.
  </pre>
  
  <p>I tried several ways to call winsat.exe:</p>
  
  <ol>
  <li><p>Call it directly by assigning <code>"winsat.exe"</code> to <code>ProcessStartInfo.FileName</code>. It fails with a <code>Win32Exception</code>: <code>The system cannot find the file specified</code></p></li>
  <li><p>As above, using the full path - <code>@"c:\windows\system32\winsat.exe"</code>. It fails with the same error.</p></li>
  <li><p>Run the code as the System Administrator. It still fails.</p></li>
  <li><p>Call winsat.exe as in the coded example. It failed as I explained earlier.</p></li>
  </ol>
  
  <p>It's interesting that the command prompt launched from the code can only see .dll files in c:\windows\system32.</p>
  
  <p>Does anyone have any idea why winsat.exe cannot be launched through <code>System.Diagnostics.Process</code>? Are there any limitations which I've misunderstood?</p>
  
  <p>Thanks,</p>
  
  <p>Rex</p>