Maybe this helps. Remove the following code snippet:
string line;
while ((line = p.StandardOutput.ReadLine()) != null)
{
tOutputStandard.Text += line + "\r\n";
}
while ((line = p.StandardError.ReadLine()) != null)
{
tOutputError.Text += line + "\r\n";
}
Connect to the OutputDataReceived and ErrorDataReceived event handlers:
p.OutputDataReceived += this.OutputDataReceived;
p.ErrorDataReceived += this.ErrorDataReceived;
.
private void ErrorDataReceived(object sender, DataReceivedEventArgs e)
{
tOutputError.Text += e.Data + "\r\n";
}
private void OutputDataReceived(object sender, DataReceivedEventArgs e)
{
tOutputStandard.Text += e.Data + "\r\n";
}