Shell of cmd.exe in a textbox?

phatty

New member
Joined
Oct 15, 2003
Messages
2
OK.. let me explain what I am trying to do and what I have already done.


What I have done: executed cmd.exe via CreateProcessA, with redirected stdoutput.. upon closing of the WritePipe, i get the stdoutput into my textbox as planned.

What I want to do: I want to have cmd.exe stay open, and be able to write to the stdin, and still receive output from the stdout. The problem is, I cannot figure out
how to do this since the output is not sent to stdout until the WritePipe is closed..

Is there a way I could manage this with threading or child or something or am I just
missing something simple. There is a working sample in VC++ @ http://www.angelfire.com/az/galore/Shell.zip , but I cannot seem to do the same thing in VB.net .. Let me know what you guys can figure out.
 
Look at the Process class in the MSDN. More specifically, look at the ProcessStartInfo.RedirectStandardOutput. This allows you to communicate with the stdin and stdout using I/O streams built into the .NET framework, rather than using complicated P/Invoke methods which would end up being more trouble than its worth.
 
I have looked at it.. I need to redirect StandardInput and StandardOutput, but the StandardOutput is not being sent until I close the WritePipe.. Thx for the suggestion though.. unless you know a way to get around that, I think I am stuck.
 
Back
Top