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.
This is the script I have currently
Process cmd = new Process();
cmd.StartInfo.FileName = "cmd.exe";
cmd.StartInfo.Arguments = @"/C mkdir C:\IL & del Output.il & cd C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools & 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();
Filepath is a parameter I pass back to this method. This parameter contains the file's URL.
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.
I've tried this process from this answer, and implemented the following code to try and get this batch file to work.
ProcessStartInfo cmd = new ProcessStartInfo( "cmd", @"/C mkdir C:\IL & del Output.il & cd C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools & ildasm /out=C:\IL\Output.il" + filePath );
cmd.CreateNoWindow = true;
cmd.UseShellExecute = false;
Process.Start( cmd );
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.
Is there anything wrong with my script? Or is there a setting that I can enable in Visual Studio?
Thanks for viewing