title: "The system cannot find the file specified" error on process.Start();
body: <p>I am trying to get the process respond as a string so I can use it in different place in my code, this is the solution that I have so far:</p>
  
  <pre><code>const string ex1 = @"C:\Projects\MyProgram.exe ";
        const string ex2 = @"C:\Projects\ProgramXmlConfig.xml";
  
  
        Process process = new Process();
        process.StartInfo.WorkingDirectory = @"C:\Projects";
        process.StartInfo.FileName = "MyProgram.exe ";
        process.StartInfo.Arguments = ex2;
        process.StartInfo.Password = new System.Security.SecureString();
        process.StartInfo.UseShellExecute = false;
        process.StartInfo.RedirectStandardOutput = true;  
  
        try
        {
            process.Start();
            StreamReader reader = process.StandardOutput;
            string output = reader.ReadToEnd();
        }
        catch (Exception exception)
        {
            AddComment(exception.ToString());
        }
  </code></pre>
  
  <p>But when I'm running this I get:</p>
  
  <blockquote>
  <pre><code>"The system cannot find the file specified" error in process.Start(); without 
        process.StartInfo.UseShellExecute = false;
        process.StartInfo.RedirectStandardOutput = true;  
  </code></pre>
  </blockquote>
  
  <p>The code runs fine but it just open console window and all the process response is trow there so I can't use it as string.</p>
  
  <p>Does anyone know why I am getting this error or maybe a different solution to my problem?</p>