I do not know if you are going to find a direct example, but it is not too difficult. I donβt have time to write all the code for you, but I can give you the code from MSDN:
Process myProcess = new Process(); ProcessStartInfo myProcessStartInfo = new ProcessStartInfo("C:\\MyBatchFile.bat" ); myProcessStartInfo.UseShellExecute = false; myProcessStartInfo.RedirectStandardOutput = true; myProcess.StartInfo = myProcessStartInfo; myProcess.Start(); StreamReader myStreamReader = myProcess.StandardOutput;
source share