CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2001
    Posts
    17

    Capturing command output.

    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.


  2. #2
    Join Date
    Sep 2000
    Location
    Ottawa, Ontario
    Posts
    356

    Re: Capturing command output.

    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.




  3. #3
    Join Date
    Mar 2001
    Posts
    8

    Re: Capturing command output.

    Check "Capturing the Output of a MS-DOS Program" at
    http://www.**************/ArticleBank...ID=ArticleBank

    JD



  4. #4
    Join Date
    Mar 2001
    Posts
    17

    Re: Capturing command output.

    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.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured