1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2007
    Rep Power

    Get output from DOS exe

    Good morning,

    I'm having the following problem... I want to capture from a delphi based language - HEScript - the output of a exe file.

    The exe is placed in a temp folder, and it runs with a function of the type:

    RunAProgram(MyProgram, "parameters", FilePath, true, SW_SHOWNORMAL);

    The best way - as far as my ignorance in Delphi goes - would be to output the exe results to a txt file in the same folder, read the contents and sent to the user the text.

    However, if I use in the parameters something like "-p > data.txt", the file data.txt is not written...

    And I don't know how to retrieve the file contents, and return to a variable...

    Any help would really, really, really be apreciated... Or any other sugestion/solution.

    Kind regards,

  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2008
    Rep Power
    Originally Posted by johannes.kepler
    -p > data.txt
    is it possible that the directory you are attempting to write data.txt to is one that requires UAC elevation? Try giving it an explicit directory that exists that does not require elevation.
    -p > c:\somedir\data.txt

IMN logo majestic logo threadwatch logo seochat tools logo