I'm looking into writing a sort of command prompt wrapper as a learning exercise. Basically the user enters a command in the console window and the command is executed via cmd.exe.
"Run Command Prompt Commands" handles the execution of the commands via cmd.exe, while "Process.start: how to get the output?" takes care of obtaining the resulting output.
There is one problem I have yet to address. This method of executing commands via cmd.exe causes a process to start, do whatever it has to do, and then terminate. So if I do something like cd..
, the expected change in state does not persist between subsequent commands, and you'll see that you remain in the same working directory.
Is it possible to execute shell commands while maintaining a persistent cmd.exe session?