At the moment I am starting a batch file from my C# program with:
System.Diagnostics.Process.Start(@\"DoSomeStuff.bat\");
What I would like
process.StartInfo.CreateNoWindow = true;
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardOutput = true;
process.OutputDataReceived += (sender, args) => Console.WriteLine(args.Data);
process.Start();
process.BeginOutputReadLine();
process.WaitForExit();
Same idea for Error, just replace Output in those method/property names.