Up Arrow button action is not writing into Standard output while standard output is redirected

31 Views Asked by At

I'm creating console application with c# which controls cmd actions from webpage. I start cmd.exe like following

                cmdProcess = new Process();
                cmdProcess.StartInfo.FileName = "cmd.exe";
                cmdProcess.StartInfo.UseShellExecute = false;
                cmdProcess.StartInfo.CreateNoWindow = false;
                cmdProcess.StartInfo.RedirectStandardOutput = true;
                cmdProcess.StartInfo.RedirectStandardError = true;
                cmdProcess.StartInfo.RedirectStandardInput = true;`

When user from web page press "Up Arrow" button i detect it and send to cmd process with PostMessage() funtion. I can see it takes action it bring previously entered command (like usual cmd application) but this previous command displayed on cmd is not redirected to standard output. That's why i cannot read it from stream and i cannot push it to web client as output.

My question: When i send up arrow button to cmd while std output is redirected even it shows previous command on screen why it doesn't write this displayed information to output stream ? or where can i read that stream ?

0

There are 0 best solutions below