Good people, I need an application that captures the input and output, so that after executing a command the same prompt is not closed.
Now I can execute commands and capture output in isolation. Here is 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;
}