Cannot launch UFT from VB script on Win 8

On Win 7 or previous version of Windows, the VB script below can be used to invoke QTP/UFT

Dim qtApp

Dim qtTest

Dim qtResultsOpt

Dim qtAutoExportResultsOpts

Set qtApp = CreateObject("QuickTest.Application")

qtApp.Launch ‘ Start UFT

qtApp.Visible = True

However, on Win 8, if UFT was set to "Run as Administrator" under "Properties" – "Compatibility", the error below will prompt out:

Error: Unspecified error

Code: 80004005

Source: (null)

It indicates that the line of "Set qtApp = CreateObject("QuickTest.Application")" causes the error.

This is because DCOM is not set properly.

The steps below will fix the issue:

1. Run "dcomcnfg.exe".

2. Select "Component Services" – "Computers" – "My Computer" – "DCOM Config".

3. Select "QuickTest Professional Automation".

4. Right click and select "Properties".

5. In the properties dialog box, switch to "Identify" tab

6. Select "The launching user" instead of "The interactive user"

Run the script again, and the issue should be resolved.