Ask a Question

Reg: Launch the window application

kumar_N
Occasional Contributor

Reg: Launch the window application

Hi..



How to launch the application available in the path, instead of Call TestedApps.notepad.Run(1, False).



E.g: I need to launch the application available in the path like c:\Allprograms\applicaiton1.



How to write script for that.





Regards

Naresh
5 REPLIES 5
karkadil
Valued Contributor

Sys.OleObject("WScript.Shell").Run("c:\\Allprograms\\applicaiton1");
kumar_N
Occasional Contributor

Hi Gennadiy Alpaev

Tx for your reply.



I was not able to run the application still. i am getting the run time error.



E.g To Run the calculator applciation.

Sys.OleObject("WScript.Shell").Run("C:\\Documents and Settings\\All Users\\Start Menu\\Programs\\Accessories\\Calculator")



Run time error is coming,"The system can't find the specified file path"





Regards

Naresh


YMinaev
Staff

Hi,



Enclose the path in quotes:



Sys.OleObject("WshScript.Shell").Run("\"C:\\Documents and Settings\\All Users\\Start Menu\\Programs\\Accessories\\Calculator\"")


------
Yuri
TestComplete Customer Care Engineer

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

Hi..

if i copy the same script in vb script its giving code compilation error.

can u please give the snippet in vb script.
karkadil
Valued Contributor

Sys.OleObject("WScript.Shell").Run("""C:\Program Files\application.exe""")



if you need to run your application with parameters, then



Sys.OleObject("WScript.Shell").Run("""C:\Program Files\application.exe"" param1 param2""")



And I really recommend you to start learning the language you are using in your scripts, because you need to be able not only recording scripts, but also write them manually...
cancel
Showing results for 
Search instead for 
Did you mean: