redirecting stdout

P

Patrick Porter

Im trying to capture the stdout from running a process from within my app.
I've been dinking around using the code straight off the MS site. i can get
"ipconfig / all" (for example) to send back its output, but not (in this
case) "nasm -v" , which displays version information.
whats happening?

slightly modified MS code:
Dim myProcessStartInfo As New ProcessStartInfo("c:\nasm\nasm", "-v")

myProcessStartInfo.UseShellExecute = False

myProcessStartInfo.RedirectStandardOutput = True

myProcess.StartInfo = myProcessStartInfo

myProcessStartInfo.CreateNoWindow = True

myProcess.Start()

Dim myStreamReader As StreamReader = myProcess.StandardOutput

' Read the standard output of the spawned process.

Dim myString As String = myStreamReader.ReadToEnd

txtOutput.Text = myString





thanks,

patrick
 
P

Patrick Porter

i adapted your stuff into mine, and i have the same problem....i can run
ipconfig /all and get the output fine, but i cant get the output from
requesting the version info from nasm (c:\nasm\nasm.exe -v). why is it that
i can get some stuff but not all?

also, thanks alot for the code sample. great stuff

patrick
 
P

Phill. W

Patrick Porter said:
Im trying to capture the stdout from running a process from within my app.
I've been dinking around using the code straight off the MS site. i can get
"ipconfig / all" (for example) to send back its output, but not (in this
case) "nasm -v" , which displays version information.

Since one works and the other doesn't -

Could "nasm" be writing this to stderr, instead of stdout?

HTH,

First guess
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top