I have a windows form that executes a batch file. I want to transfer everything that happends in my console to a panel in my form. How can I do this? How can my DOS console
You should start off by adding a reference to System.Diagnostics, then calling the batch file like this:
string myFile = "c:\\path\\to\\batch_file.bat";
ProcessStartInfo psi = new ProcessStartInfo(myFile);
psi.UseShellExecute = false;
psi.CreateNoWindow = true;
psi.RedirectStandardOutput = true;
Process proc = Process.Start(psi);
Now, if you want the call to be blocking (I.E., your application will freeze until the file is done), then just use string result = proc.StandardOutput.ReadToEnd() to read the entirety of your batch file's output.
However, if you want to have the application continue to respond, as well as display output in real-time, then you'll need to have to use BeginOutputReadLine.