Forum Discussion

divernut's avatar
divernut
Occasional Contributor
15 years ago

Opening multiple CMD windows. only first one works

I am running Testcomplete via a batch file. So when I open a CMD window from testcomlete to open other apps nothing gows into the CMD. If I run the test from within Testcomplete everything runs fine. Somehow the batchfile cmd is getting the attention instead of the one opend from Testcomplete. I have tryed changing properties and mapping multiple CMD.exe items but I am missing something.





Robert

6 Replies

  • Hi Robert,



    As I understand, you need to execute a command line from TestComplete. If so, there is no need to invoke cmd directly - you can use the approach demonstrated in the following HowTo entry:


    Run a ClickOnce application
  • divernut's avatar
    divernut
    Occasional Contributor
    I am able to get multiplw cmd forms to open but testcomplete is not writing the cammand into the cmd window onec it is open. I run testcomplet from a batch file. When the second cmd window opens testcomplete does not seem to point to it. I tried changing properties and mapping names but just cant quite figure out how to word the script so testcomplete will point to the second cmd window.



    Robert

  • Hi Robert,





    When multiple processes with the same name exist in your system, you can use process indexes to identify a process. However, this approach is not quite reliable. Could you please clarify why the approach suggested in my previous e-mail does not suit your needs?


  • divernut's avatar
    divernut
    Occasional Contributor
    I did run your code example and it opens the cmd window but Testcomplete is still looking back to the batch file cmd window as the active window. I need to figure out how to let the cmd window opend by testcomplete be the active window to put the path for the exe to run. I know it sounds confusing so I hope this helps.



    Robert
  • Hi Robert,



    It looks like you misunderstood my suggestion. If you use the approach demonstrated in the How To entry, you do not need to use the cmd window at all. The WshShell.Run method allows executing any command line without invoking the cmd window. Just pass the needed string as the method's argument. Does this work for you?
  • divernut's avatar
    divernut
    Occasional Contributor
    Now I understand. I don't have to open a cmd window to pass the cammand to. This makes my life so much easier. I still have a LOT to learn about Testcomplete. Thank you so much for your help. YOU ROCK!!!!!!!!!





    Robert