VideoHelp Forum
+ Reply to Thread
Results 1 to 3 of 3
Thread
  1. Member RogerTango's Avatar
    Join Date
    Nov 2007
    Location
    United States
    Search Comp PM
    Maybe the title doesnt make sense, as I re-read it... Im confused!

    Ive got a nifty QB45 executable that Id like to call from a batch file, the exe outputs text (stdout), Id like to capture the exe's output into a variable in a batch file.


    Any ideas? Im a DOS junkie... Was working with computers waaaay before Windows 3.0!

    Thanks for any help,
    Andrew
    Quote Quote  
  2. Member RogerTango's Avatar
    Join Date
    Nov 2007
    Location
    United States
    Search Comp PM
    Just figured it out...

    for /f "tokens=*" %%a in ('dtshow.exe') do set dt=%%a
    echo %dt%

    Where dtshow.exe is my executable, and var dt is set to it's output..

    Andrew
    Quote Quote  
  3. Member dragonkeeper's Avatar
    Join Date
    Jul 2003
    Location
    United States
    Search Comp PM
    There are many ways to do this, I'm a bit rusty haven't written a bath script in years.

    Another another method would to set an environmental variable then read it, just be sure to do house clean afterwards. Or you can pipe the output to a text file and read from the text file, which is i use to do when building the batch scripts. I could run the program once to generate the text file, then build the script using the generated text file as my source. I could make necessary corrections & tweaks all without re-running the program which in environment i was a plus, it could take some time to rerun a program.
    But one of things I liked to do was wrap an HTA around the scripts so end users/clients could run the script (everyone is intimidated by command line). In the HTA I could use activeX to create an instance of "WScript shell" to run external programs and set JavaScript variables. You gain access to all the shell commands as well, you would be suprised at the things you could do with this method it takes your windows scripting writing capabilities to new heights.
    Murphy's law taught me everything I know.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!