SPONSORS:






User Tag List

Results 1 to 5 of 5
  1. #1
    Junior Member
    Join Date
    Sep 2002
    Location
    chennai
    Posts
    8
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Execution of command line programs

    I have a program called CSDiff.exe located in the ProgramFiles folder. Now I wan to run this program from command line by saying
    'CSdiff test1.txt test2.txt /Houtput.html'

    I want to do this while executing my testcase. I dont want to use the CommandlineWindow.TypeKeys() option. I want to know if there is any funtion that can pass this string('CSdiff test1.txt test2.txt /Houtput.html') to commandline and execute it.
    SYS_Execute() function only executes system commands, not external commandline programs.


    ------------------

  2. #2
    Member
    Join Date
    Jan 2002
    Location
    Nuremberg, Germany
    Posts
    77
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Execution of command line programs

    Why do you not want to use typekeys? I've been working with a method described in forum 002635.html (see second post in there) ever since without any problems.



  3. #3
    Senior Member
    Join Date
    Jul 1999
    Location
    Bellingham, WA USA
    Posts
    1,323
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Execution of command line programs

    nikilesh,

    I'd pose the same question, but knowing there are reasons not to use the command line, you have the option of using the Start method as well, or you can write a dll that will fire off executables. Our teams uses just such a dll with a "ShellProcess" command in it.

    ------------------

  4. #4
    Senior Member
    Join Date
    Jul 2000
    Posts
    117
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Execution of command line programs

    ... and I'm confused by your final sentence: "SYS_Execute() only executes system commands ...".

    We've been successfully using SYS_Execute() to run just about everything under the sun, including "external commandline programs". We use it to run our server when we need to capture console output, various 3rd party compilers, etc.

    In your case, try something like:

    SYS_Execute ("<full-path>\CSDiff test1.txt test2.txt", lsOutput)

    Then you should be able to "dump" lsOutput into output.html as a second step.

    Another option is the APP_Start() function.

    Hope this helps.

    ------------------

  5. #5
    Junior Member
    Join Date
    Sep 2002
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Execution of command line programs

    Here's a snippet you'll find useful I think...

    (I tried showing the indentations correctly)

    [-] private window MainWin CommandLineExecutor
    ___[ ] string sCmdLine
    [-] Execute(string AppFullPath)
    ___[ ] // Since there's a bug with SYS_Execute(),
    ___[ ] // let's run our exe with a dummy window declaration...
    ___[ ] CommandLineExecutor.sCmdLine = AppFullPath
    ___[-] withoptions
    ______[ ] BindAgentOption(OPT_WINDOW_TIMEOUT, 0)
    ______[ ] CommandLineExecutor.Invoke()

    [This message has been edited by Daniel5 (edited 09-26-2002).]

 

 

Posting Permissions

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

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 09:23 PM.

Copyright BetaSoft Inc.