What I want to do is run a command in C# through a console command window. What I want this command to do is run an existing exe file with my given input and print the output to a different file.
I have this code:
System.Diagnostics.Process pProcess = new System.Diagnostics.Process();
string l_sCommand = string.Empty;
l_sCommand += "exe file" + "<" + "Input txt file" + ">" + "output txt file";
System.Diagnostics.ProcessStartInfo procStartInfo =
new System.Diagnostics.ProcessStartInfo("cmd", "/c " + l_sCommand);
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.StartInfo = procStartInfo;
proc.Start();
but this doesn't work. does anyone have any idea why?