SPONSORS:






User Tag List

Results 1 to 6 of 6

Thread: Command Prompt

  1. #1
    Junior Member
    Join Date
    Feb 2000
    Posts
    6
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Command Prompt

    I have to drop down to the dos command prompt to initiate a batch file and monitor it while it's running. Of course, I want to automate the whole process, but can't figure out how to notify Silk when it's done. I could use the clipboard to look for messages but that's kinda messy. Any ideas?? Thanks in advance...
    Larry Nick
    Principle Test Engineer
    nick@pv.com

  2. #2
    Senior Member
    Join Date
    Jul 1999
    Location
    Burlingame CA 94010
    Posts
    502
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Command Prompt

    Is there some text which appears in the DOS window when its finished. You could try to make an educated guess about how long is will take, then read the text in the window and look for the specific message which lets you know is has completed. If it hasn't, just sleep for a few (seconds or minutes), then check again. Use the Edit Menu to copy the text in the window to the Clipboard.

    Another idea is to have the batch file delete and then write a specific file to the disk when it finishes. Have SilkTest watch for the file to exist, and close the window when it finds the file, or the timeout period expires.

    ------------------
    John W Green
    jwgreen@automationexpertise.com
    http://www.automationexpertise.com

  3. #3
    Senior Member
    Join Date
    Sep 1999
    Location
    San Jose,CA,USA
    Posts
    340
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Command Prompt

    Well here is one idea .. you could create via VC++,Visual Basic, Java, or TCL a simple dialog box at the very end with a sufficiantly unique title, like "Hey Silk I am done!" Then call the executable at the end of your batch script before it exits.


    In the dialog box's text field enclose the return code. Then have silk parse for the existance of this dialog box. Or you could employ a registry entry, or a file or probably 10 other good to great solutions.

    I have a general purpose dll written to display messages and text for a dialog box class. Not too sure that would be of any help in batch file (I simply don't know anything about dos bat and dll calls).


    ------------------
    "Smoke me a kipper, I'll be back for breakfast!"
    Sincerely
    Richard Weth
    Sr. QA Engineer
    mailto:rick_weth@yahoo.com

    [This message has been edited by rick_weth (edited 02-24-2000).]
    Smoke me a kipper, I'll be back for breakfast!
    Sincerely
    Richard Weth
    Sr. QA Engineer

  4. #4
    Senior Member
    Join Date
    Sep 1999
    Location
    San Jose,CA,USA
    Posts
    340
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Command Prompt

    Hey all

    In an attempt to make life a little easier for everyone I whipped up a very simple executable I new enclose:
    Batch_Silk_Signal.exe

    Simply execute this in your batch file via this line:
    start D:\QA\bin\Batch_Silk_Signal.exe

    I find it best to stick executables in your search path so all you really have to do is code this:
    start Batch_Silk_Signal.exe

    You will be left with a dialog box with the unique title:
    "Signal Batch Exit for Silk"

    Now you can look for a dialog box that will actually appear at the end of your batch file. It's probably a good idea to dismiss dialog boxes like this before you begin.

    Try it you may like it!!




    ------------------
    "Smoke me a kipper, I'll be back for breakfast!"
    Sincerely
    Richard Weth
    Sr. QA Engineer
    mailto:rick_weth@yahoo.com
    Smoke me a kipper, I'll be back for breakfast!
    Sincerely
    Richard Weth
    Sr. QA Engineer

  5. #5
    Senior Member
    Join Date
    Aug 1999
    Location
    MA
    Posts
    129
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Command Prompt

    The trick I use when I have to shell out to "DOS" on Win 9x / Win NT is to run command.com /c from Start-->Run on the start menu. The /c switch will cause the DOS window to go away immediately when the operation is done, be it a batch file, pkzip, findstr, whatever...

    For example, on WinNT if you wanted to write the contents of your C drive to a text file, you would use:
    $WINDIR\system32\command.com /c dir c:\ /s > c:\scratch\test.txt

    Note: I do a SYS_GetEnv($WINDIR) and write this at runtime to a constant string in one of my include files, so I look it up once when running on any particular system. Same goes for where to find command.com, on WinNT you have to append System32, on Win9x it is only System.

    I then use my "WaitTillDeclaredWindowGoesAway" function to detect when the DOS box has dissapeared and continue along with the Silk script.

    [This message has been edited by styler (edited 02-25-2000).]
    Steven Tyler
    Manager - Performance Engineering

    Kronos Incorporated
    tel: +1 978 947 4219

  6. #6
    Junior Member
    Join Date
    Nov 1999
    Location
    Seattle, WA, USA
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Command Prompt

    I have a simple way of doing this. If I just want to run one command from a dos box, I use the fact that the title bar of the dos box contains the currently running command. So I just grab the window title periodically and check to see if the command I ran is in there or not.

 

 

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 04:18 AM.

Copyright BetaSoft Inc.