Example 1.
Running a command line application, without concern for the results:
private void Run(){
System.Diagnostics.Process.Start(@”C:\runFile.bat”);
}
Example 2.
Retrieving the results and waiting until the process stops (running the process synchronously):
private void Run(){
System.Diagnostics.ProcessStartInfo psi =
new System.Diagnostics.ProcessStartInfo(@”C:\listfiles.bat”);
psi.RedirectStandardOutput = true;
psi.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
psi.UseShellExecute = false;
System.Diagnostics.Process listFiles;
listFiles = System.Diagnostics.Process.Start(psi);
System.IO.StreamReader myOutput = listFiles.StandardOutput;
listFiles.WaitForExit(2000);
if (listFiles.HasExited){
string output = myOutput.ReadToEnd();
this.processResults.Text = output;
}
}

![[FIX] BizTalk Server 2010, 2013, 2013 R2 & 2016 errors “Class not registered (WinMgmt)” or “Access denied”](https://blogit.create.pt/wp-content/uploads/2018/07/access-black-and-white-blur-270514-218x150.jpg)



















![Converting Hexadecimal string to byte[]](https://blogit.create.pt/wp-content/uploads/2018/08/net-100x70.jpg)