Click to See Complete Forum and Search --> : Capturing command output.


yaronb
March 26th, 2001, 09:27 AM
I would like to run commands on the Command Prompt window and capture their output. What is the best way to do that ? (Shell function doesn't work for me, cause it doesn't return the output).

Yaron.

Jean-Guy2000
March 26th, 2001, 09:42 AM
You can try re-directing to a output file then parsing the file..

shell "MYDOSAPP.EXE > RESULT.TXT"

then open RESULT.TXT. it's crude but it may work for you.

Jean David
March 27th, 2001, 01:38 AM
Check "Capturing the Output of a MS-DOS Program" at
http://www.vb2themax.com/ArticleBank.asp?PageID=ArticleBank

JD

yaronb
March 27th, 2001, 03:47 AM
Redirecting the output to a file works if the command executes fully without further input, but what if I want to capture the output of a complete FTP session ? That involves reading process output throughout the entire session, and not just at the end of it. I want to be able to read the output at the moment that it's sent out , and not at the end of the session.
Something that is similiar to PERL's Expect module.

Know how I can do this?
Yaron.