title: Process.StartInfo.UseShellExecute related error
body: <p>i have 1 c# console appln,it executes any script file by using Process.Start() method. i provide script file path to <code>Process1.StartInfo.FileName</code>.My script file can be of any type (.vbs ,ps1 etc) . I m also passing String  to script by using instruction <code>p.StartInfo.Arguments</code>. When script file executed it should retrun string back to c# application. This returned string can be read by setting <code>Process1.StartInfo.RedirectStandardOutput = true</code>,But for using this instruction i need to set <code>Process1.StartInfo.UseShellExecute = false</code>.
   When i run this i m getting error as "The specified executable is not a valid Win32 application".
   i think this may be because of, when i set <code>Process1.StartInfo.UseShellExecute = false</code>, my appln dont know which .exe to be used to execute script file. </p>
  
  <p>on the other hand if i provide exe path to <code>StartInfo.FileName</code> and script file path to <code>StartInfo.Argument</code> then i m not getting error. 
  For Example:i want to execute powershell script and i set following properties as <code>P1.StartInfo.FileName = "location of powershell.exe"</code> and <code>p1.startInfo.Argument =".ps1 script file path"</code>, in this case i m not getting error.</p>
  
  <p>problem is i dont know in advance,which type of script i m going to execute.also cant find out locations of .exe file for executing script file on different diffrent m/c. So is it possible to execute diffrent type of script files from same common c# appln and also read output returned by scripts? </p>
  
  <p>here is my code</p>
  
  <pre><code> using System;
   using System.Collections.Generic;
   using System.Text;
   using System.Diagnostics;
   using System.Collections;
   namespace process_csharp
   {
      class Program
      {
         static void Main(string[] args)
         {
          String path = null;
          //this will read script file path 
          path = Console.ReadLine();
  
          //this string is passed as argument to script
          string s = "xyz";
  
          Process p = new Process();          
          p.StartInfo.FileName= path;         
          p.StartInfo.Arguments = s;                     
          p.StartInfo.UseShellExecute = false;
          p.StartInfo.RedirectStandardOutput = true;      
  
          p.Start();
          p.BeginOutputReadLine();
          Console.WriteLine(p.StandardOutput.ReadToEnd());
        }
  
      }
    }
  </code></pre>