you are familiar to "..." block same as my first reply ... System.Diagnostics.Process pr = new System.Diagnostics.Process(); pr.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal; pr.StartInfo.FileName = "cmd.exe"; pr.StartInfo.UseShellExecute = false; pr.StartInfo.RedirectStandardInput = true; pr.StartInfo.RedirectStandardOutput = true; pr.Start(); pr.OutputDataReceived += new System.Diagnostics.DataReceivedEventHandler(pr_OutputDataReceived); pr.BeginOutputReadLine(); System.IO.StreamWriter swWriter = pr.StandardInput; swWriter.WriteLine("echo SomeTextHere\n"); swWriter.Flush(); ... //Define a delagate function delegate void SetTextCallback(string text); //Define a function for setting void SetText(string text) { if (this.textBox1.InvokeRequired) { SetTextCallback d = new SetTextCallback(SetText); this.Invoke(d, new object[] { text }); } else { this.textBox1.Text = text; } } void pr_OutputDataReceived(object sender, System.Diagnostics.DataReceivedEventArgs e) { //event fired and u have data use it thread-safe SetText(e.Data); } if this does not work define your problem with more details
UMS