I am trying to run a process in c# using the Process class.
Process p1 = new process(); p1.startinfo.filename = \"xyz.exe\"; p1.startinfo.arguments = //i a
You can use CliWrap to make piping really easy, without the overhead of a console, and also completely x-platform:
var output = File.Create("output.txt"); // stream is just one of the options var cmd = Cli.Wrap("xyz.exe") | output; await cmd.ExecuteAsync();