title: the following command was not found netsh
body: <p>I'm trying execute a couple of "netsh" commands but no matter what I do I keep getting the same error "the following command was not found netsh".</p>
  
  <p>I can verify that the path "C:\Windows\System32\netsh.exe" is valid and when I run the same command with the same set of arguments through the command prompt; everything works fine.</p>
  
  <p>This a sample of the code I'm using.</p>
  
  <pre><code>ProcessStartInfo procInfo = new ProcessStartInfo
              {
                  WorkingDirectory = System.IO.Path.GetPathRoot(System.Environment.SystemDirectory),
                  FileName = @"netsh.exe",
                  RedirectStandardOutput = true,
                  RedirectStandardError = true,
                  UseShellExecute = false,
                  CreateNoWindow = true,
                  Arguments = String.Format(@"{0}\{1} {2}", System.Environment.SystemDirectory, @"netsh.exe", "wlan start hostednetwork"),
                  WindowStyle = ProcessWindowStyle.Hidden
              };
  
              Process proc = Process.Start(procInfo);
              proc.WaitForExit();
  </code></pre>