cancel
Showing results for 
Search instead for 
Did you mean: 

Executing shell commands?

nicklas
New Contributor

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 4
YMinaev
Staff

RE: Executing shell commands?

Hi Nicklas,



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

------
Yuri
TestComplete Customer Care Engineer

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
nicklas
New Contributor

RE: Executing shell commands?

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
Community Hero

RE: Executing shell commands?

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. 

Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
nicklas
New Contributor

RE: Executing shell commands?

That worked!



Thanks!



//Nicklas

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors