Execute and get STDOUT results?

Jaxbot

Newcomer
Joined
May 2, 2008
Messages
9
Hi, how do I run a program and get the results it sends?

Shell returns the process ID, and I'm sure I just have the command wrong.

Thanks :)

EDIT: Here's what I mean:

MsgBox(Shell("php c:\test1.php"))

test1.php returns "MEH". I want that result in the msgbox. (I have a more complex use but that's the test part for now).
 
See this thread

Thank you for the off topic, invaild, and otherwise pointless reply.

He's right, you should be using MessageBox.Show(). MsgBox and Shell are functions that only exist for backwards compatibility with VB6, and you should aim to move away from them in .NET applications.

Back to the main question, the following thread has some code which you might find useful:

Redirect Ping Output To A Textbox In The Form?

It uses classes in the System.Diagnostics namespace as Nate Bross mentioned above.
 
Back
Top