Forum Discussion

nicklas's avatar
nicklas
New Contributor
15 years ago

Executing shell commands?

Hi,

Is there any way to make calls like "excelcompare filea fileb" without putting them in tested apps? Like a simple ShellExecute(AFilename : string) or similar?



I have searched everywhere in the documentation, and probably missed something, but I can't find it!



//Nicklas

4 Replies

  • Hi Nicklas,



    You can use the WScript.Shell object to do this (the Run or Exec method). This object is described here.

  • nicklas's avatar
    nicklas
    New Contributor
    Hi,

    I can't find that object being defined anywhere, also TC does not recognize it.

    Also, there is no CreateObject function, so I can create it through that either.

    I'm a bit stumped.



    //Nicklas

    PS.

    BTW, our TC-version is 6.52.

    DS.





  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    You should be able to instantiate the Wscript.Shell object using





    Sys.OleObject('Wscript.Shell')




    You can then use any of the properties or methods of that object within your automation.