title: Why is this Command Prompt Script not running in C#?
body: <p>I need to run a bunch of commands in C# in order for my program to run correctly. Previously, this script ran flawlessly and I used to get the desired output my program needs in order to compile and run correctly.</p>
  
  <p>This is the script I have currently</p>
  
  <pre><code>Process cmd = new Process();
  cmd.StartInfo.FileName = "cmd.exe";
  cmd.StartInfo.Arguments = @"/C mkdir C:\IL &amp; del Output.il &amp; cd C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools &amp; ildasm /out=C:\IL\Output.il " + filePath;
  cmd.StartInfo.UseShellExecute = false;
  cmd.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
  cmd.StartInfo.RedirectStandardOutput = true;
  cmd.StartInfo.CreateNoWindow = true;
  cmd.StartInfo.RedirectStandardError = true;
  cmd.Start();
  </code></pre>
  
  <p>Filepath is a parameter I pass back to this method. This parameter contains the file's URL.</p>
  
  <p>When the filepath is loaded into the application now, this set of commands does not run whatsoever. There is no output file or anything. However, these commands run when I enter them manually into Command Prompt.</p>
  
  <p>I've tried this process from <a href="https://stackoverflow.com/questions/44928712/process-start-wont-work-cmd-window-c-sharp">this</a> answer, and implemented the following code to try and get this batch file to work.</p>
  
  <pre><code>ProcessStartInfo cmd = new ProcessStartInfo( "cmd",  @"/C mkdir C:\IL &amp; del Output.il &amp; cd C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools &amp; ildasm /out=C:\IL\Output.il" + filePath );
  cmd.CreateNoWindow = true;
  cmd.UseShellExecute = false;
  Process.Start( cmd );
  </code></pre>
  
  <p>The above method hasn't worked out, and the other posts on here have the same code as my own script, which doesn't help at all.</p>
  
  <p>Is there anything wrong with my script? Or is there a setting that I can enable in Visual Studio?</p>
  
  <p>Thanks for viewing</p>