-1
Good people, I need an application that captures input and output, so that after the execution of a command the same "prompt" is not closed.
I can currently execute commands and capture output in isolation. Follow the function I did:
public string Cmd(string comand)
{
cmd.StartInfo.FileName = "cmd.exe";
cmd.StartInfo.Arguments = string.Format("/c {0}", comand);
cmd.StartInfo.UseShellExecute = false;
cmd.StartInfo.CreateNoWindow = true;
cmd.StartInfo.RedirectStandardOutput = true;
cmd.Start();
string output = cmd.StandardOutput.ReadToEnd();
if (output == "") { output = "Comando executado"; }
return output;
}
The idea is to keep the prompt open and receive commands from the "other side" until it gives some signal to close?
– João Martins
Simm @Joãomartins
– marotta