I created a cmd process in which I display the output to a window. I would like to be able to terminate the command like pressing Control-c in the command prompt.
new ProcessStartInfo("cmd.exe");
The only option I can think of is to terminate the process. Is this what pressing control-c does? The problem with this is some user settings will be lost. Two I can think of are prompt and the current directory. could there be any others? I can remember these and create a new process and reset them. Or is there another way to simulate the interruption?
You can start a process by calling the Start method. You can also end the process by calling the Kill method. All well and good. Now lets start a process by running cmd.exe and redirecting the input and output. So now assume we execute a command that takes a long time. It would be nice to cancel the command like we can do in a DOS window (Command Prompt) instead of forcing the user to close and reopen the app losing their history in the process.
I can provide more details if necessary.