SPONSORS:






User Tag List

Results 1 to 7 of 7
  1. #1
    Junior Member
    Join Date
    Mar 2001
    Location
    Redmond, WA USA
    Posts
    5
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Executing a batch file

    User Brose, Eric (eric.brose@attws.com) posted:

    Hi. I want to have Silk Launch a simple .bat file (NT) that cleans out some
    cookies. Is there a method I can use to invoke this?

    The Start method wants you to use the name of the mainwindow in front of the
    window. I can fake this name and get the .bat file to launch, but Silk will
    wait around for the window to appear (the dos box is up for about 1/8th of a
    second). I can set the method to time out right away, but I don't want an
    error message appearing.
    Any advice?

    Thanks,
    Eric



    [Non-text portions of this message have been removed]


    Post message: silktest@yahoogroups.com
    Subscribe: silktest-subscribe@yahoogroups.com
    Unsubscribe: silktest-unsubscribe@yahoogroups.com
    List owner: silktest-owner@yahoogroups.com
    URL to this page: http://groups.yahoo.com/group/silktest


    Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/



  2. #2
    Senior Member
    Join Date
    Nov 2000
    Location
    Bloomington, IL
    Posts
    142
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Executing a batch file

    Try SYS_Execute.

    Mike

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

  3. #3
    Member
    Join Date
    Aug 2000
    Location
    Hyderabad,AP,India
    Posts
    80
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Executing a batch file

    Hi Friends,

    I got a solution may be a bit longer one....


    It is sure that a DOS window appears when we double click on the batch file ICON.....I just defined that window as DialogBox

    window DialogBox BatchWindow
    tag "*cmd.exe"

    now what I did is I defined a MainWin as follows...

    window MainWin MyWindow

    const sCmdLine = "(path_of_batchfile)"

    const sDir = "(path_of_the_directory)"

    const wStartup = BatchWindow

    const lwLeaveOpen = BatchWindow

    .....

    Now what all I need is to Invoke the MainWin in my testscript....

    MyWindow.Invoke ()

    and the batch file runs....




    Baseer


    [This message has been edited by Baseer (edited 07-12-2001).]

  4. #4
    Junior Member
    Join Date
    Jun 2001
    Location
    Chennai, TamilNadu, India
    Posts
    11
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Executing a batch file

    Hi

    If I have understood your problem correct, the answer for that is available in Silk Test help under heading "commandline switches:for the partner command".

    Try this out.

    Bye
    venky

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

  5. #5
    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: Executing a batch file

    I don't recall why I needed to do it this way, but I recall a test some time back that required me to send a TypeKeys() to a command box. Worked just fine.

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

  6. #6
    Senior Member
    Join Date
    Aug 1999
    Location
    Irvine, CA
    Posts
    157
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Executing a batch file

    Here is a function I wrote for executing a command from a command prompt.

    <code>
    [-] SYS_RunCMDLine(string sCMD)
    [-] // About
    [ ] // DESC: This is an asynchronous function. Command is executed at command prompt, and the script moves on
    [ ] // even if the command has not completed.
    [ ] //
    [ ] // IN: sCMD - command to execute just as it needs to appear at the command prompt
    [ ] //
    [ ] // OUT: NULL
    [ ] msw95, msw98 string sCommand="command.com" // 95/98 command window
    [ ] mswnt string sCommand="cmd.exe" // NT/W2K command window
    [ ]
    [-] do
    [ ] MainWin("*").Start("{sCommand} /c {sCMD}")
    [-] except
    [-] if ExceptNum() != -27800 // check for MainWin not found exception and ignore
    [ ] ExceptLog () // Log all other exceptions

    </code>

    ------------------
    Matt Gray
    Kofax Image Products
    Matt Gray

  7. #7
    Member
    Join Date
    Jun 2001
    Location
    Berkeley, CA, USA
    Posts
    67
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Executing a batch file

    Whenever I need to run a batch file I create a dummy MainWin and run the batch using the Start method.

    If you place it in a do...except loop you can get around the Start method expecting a MainWin to appear.

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

 

 

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 10:44 PM.

Copyright BetaSoft Inc.