title: XCopy does not work with UseShellExecute = false
body: <p>I am trying to run a Batch file from .net/c# using System.Diagnostics.Process. Somehow it does not execute xcopy command of the Batch file.</p>
  
  <p>Sample Batch File:</p>
  
  <pre><code>#copy test to test2 including sub directories
  xcopy c:\test\ c:\test2 
  </code></pre>
  
  <p>C# code:</p>
  
  <pre><code>    public void RunMSIBatchFile(string _workingDirectory, string batchFileName)
      {
          var process = new Process
          {
              StartInfo =
              {
  
                  UseShellExecute = false,
                  RedirectStandardOutput = true,
                  WorkingDirectory = _workingDirectory,
                  FileName = _workingDirectory + batchFileName,
                  CreateNoWindow = true,
                  RedirectStandardError = true
              }
          };
  
          process.OutputDataReceived += ProcessOutputDataReceived;
          process.Start();
          process.BeginOutputReadLine();
          process.WaitForExit(Convert.ToInt32(CommandTimeOut.TotalMilliseconds));
      }
  </code></pre>
  
  <p>If I change UseShellExecute to true then it works but then there seems to be no way to capture standard output.</p>
  
  <p>Has anyone faced such problem?</p>