This below code launches QuickTest Professional.
1. I made a folder with the name 'qtp' under c:\
2. I wrote the below code in a notepad file and saved it as launch.vbs under c:\qtp
3. Now I went to command prompt (Start->All Programs->Accessories->Command Prompt). On the C:\> prompt I wrote:
C:\>cd qtp4. The command prompt now was:
C:\qtp>
5. Then I wrote file name (launch.vbs) and hit enter. It launched QTP Application.
CreateObject:
We first create an instance of an object and its reference is stored in a vbscript variable (like first two lines of the code below). Then we can access methods and properties of an object using variable.method_name and variable.property_name
For Example to open a word application and to get its version, use the below code. Write it in a notepad, save it as .vbs file and run it.Dim WordApp
Set WordApp = CreateObject("word.application")
WordApp.Application.Visible = True
x=WordApp.Application.Version
msgbox x