Post #10 has an error, because it exits prematurely, before reading the content. Take a quick look at post #14, but run your own command.This is one of the most useful pieces of code I have come across in the Codebank.
A quick question: The code in post #10 always clears the TextBox first, then updates it with the results of the next command. How could this 'clear first' be inhibited, so the TextBox shows continuous output, as a normal cmd would do?
Do you want the window not to exit? You don't have to command the exit.
How many commands do you wish to run?
You could append the textbox after each command, by doing something like this:
Code:SW.WriteLine("A command here") TextBox1.Text &= SR.ReadToEnd SW.WriteLine("Another command here") TextBox1.Text &= SR.ReadToEnd




Reply With Quote