PDA

View Full Version : Displaying Command Prompt Info.



Marcster
03-27-2006, 09:01 AM
Is there a way to display in a VBA messagebox the
results of a program run in the Windows Command Window?.

For example (Run > CMD > IPCONFIG) will display
the Windows IP Configuration.
It's this info I'm wondering if it's possible to
display in a VBA messagebox.

I don't need to display the IP address,
I just gave this as an example.

I've tried the VBA Shell command but
it returns the programs task ID if successful,
otherwise returns a zero.

I could send the output to a file, and read the contents
of that file and display in a message box.

Does anyone have any idea's?.

Thanks,

Marcster.

Killian
03-28-2006, 03:59 AM
Hi Marc,

This can normally be done by piping the output to a text file then reading that.
There's a solution to a similar problem here (http://www.vbaexpress.com/forum/showthread.php?t=5233&page=2)