How could I tell the program “test.exe” (which is a console application) to output its result to a file.
E.g. usually the program can output the data by doing test.exe > output.txt at the prompt.
How could this be done in this statement?
Process.Start("test.exe", "\"" + exename + "\"").WaitForExit();
and if you only want to redirect the output to a file, called piping, you can ask cmd.exe to do that for you. i.e.