IBM Support

Running a VBScript to access ClearQuest on 64-bit Windows results in ActiveX error

Troubleshooting


Problem

Attempts to run a VBScript to access IBM Rational ClearQuest on a 64-bit Microsoft Windows system results in the error "ActiveX component can't create object: 'CLEARQUEST.SESSION'".

Symptom

Running on a 64-bit Windows 2008 system, a VBScript that contains the following line of code invokes an error:

Set MySession = CreateObject("CLEARQUEST.SESSION") 


Here is the error message that displays:


---------------------------
Windows Script Host
---------------------------
Script: C:\Documents and Settings\Administrator\Desktop\test_VBS.vbs
Line: 1
Char: 1
Error: ActiveX component can't create object: 'CLEARQUEST.SESSION'
Code: 800A01AD
Source: Microsoft VBScript runtime error

---------------------------
OK
---------------------------

Cause

The incorrect script host was used.

Two script hosts are available within the Windows Script Host environment:

  • cscript, the command line script host
  • wscript, the graphical script host

Either script host can be used, but it is important that the correct version (64 bit or 32 bit) is used.

On the 64-bit Windows operating system, there are 64-bit and 32-bit versions of cscript.exe and wscript.exe.

Typically, the script hosts reside in the following directories:
  • 64-bit script hosts:

C:\WINDOWS\system32\cscript.exe
C:\WINDOWS\system32\wscript.exe

  • 32-bit script hosts:

C:\WINDOWS\SysWOW64\cscript.exe
C:\WINDOWS\SysWOW64\wscript.exe


The 32-bit script hosts can create and use only 32-bit COM components, and the 64-bit script hosts can create and use only 64-bit COM components.

By default, on 64-bit Windows operating systems, VBScript files are associated with the 64-bit script hosts. However, Rational ClearQuest COM components are 32 bit.

Environment

The error is reproducible on Microsoft Windows Server 2003 R2 Standard, 2003 R2 Enterprise 64 bits.

Resolving The Problem

To resolve the issue, run the VBScript files with a 32-bit script host.

Procedure:

Disclaimer

This solution contains information about modifying the system registry. Before making any modifications to the Microsoft Registry Editor, it is strongly recommended that you make a backup of the existing registry. For more information describing how to back up the registry, refer to Microsoft Knowledge Base article 256986


  1. Edit the following Windows registry key values to start VBScript files with a 32-bit script host:
    1. Change HKEY_CLASSES_ROOT\VBSFile\Shell\Open\Command to %SystemRoot%\SysWOW64\wscript.exe "%1" %*
    2. Change HKEY_CLASSES_ROOT\VBSFile\Shell\Open2\Command to %SystemRoot%\SysWOW64\cscript.exe "%1" %*

  2. Change your file preferences to always run .vbs files with the 32-bit wscript.exe script host:
    1. Right-click a .vbs file and select Open With
    2. In the Open With dialog box, click Browse to locate the 32-bit version of the wscript.exe script host:

      C:\WINDOWS\SysWOW64\wscript.exe

  3. Select the Always use the selected program to open this kind of file check box

Related Information

[{"Product":{"code":"SSSH5A","label":"Rational ClearQuest"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"API","Platform":[{"code":"PF033","label":"Windows"}],"Version":"7.1.1","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
29 September 2018

UID

swg21447229