title: How to run output from the batch file in c#.net
body: <p>I am trying to install a Windows Installer File i.e. BAT file which consist of DOS command.I want to run BAT file and extract DOS command from BAT file and re-run the DOS command, in order, to install proper driver. I did search a lot but I couldn't able to get solution for that. I am able to run .exe file.</p>
  
  <p>here is my code -</p>
  
  <pre><code>ProcessStartInfo aProcessInfo;
  Process aProcess = new Process();
  
  aProcessInfo = new ProcessStartInfo(command);
  aProcessInfo.UseShellExecute = false;             
  aProcessInfo.RedirectStandardOutput = true;
  aProcessInfo.RedirectStandardError = true;
  aProcessInfo.CreateNoWindow = true;
  
  aProcess = Process.Start(aProcessInfo);
  aProcess.WaitForExit();
  </code></pre>
  
  <p>My BAT file is install.bat; which when I click on edit open DOS command like</p>
  
  <p>cls</p>
  
  <p>msiexec /quiet /passive /i lcild_v207230.msi</p>
  
  <p>in notepad.</p>
  
  <p>Can anyone explain me how to extract and install driver from BAT file.</p>
  
  <p>Thanks.</p>