CreateObject64 Statement
Description
Creates a 64-bit COM object and returns a reference to it.
Syntax
Set MyNewObject = CreateObject64(objectProgID)
Argument | Type | Description |
---|---|---|
ProgID | String | The ProgID of the 64-bit COM object you want to create. |
Return Value
Variant. Returns a reference to the created object.
IMPORTANT
If you run a CreateObject64 step on a 32-bit computer, it creates a 32-bit COM object like the standard VBScript CreateObject statement.
Tip: If your application installs different modules for 64-bit and 32-bit clients, you may still want to check whether the test is running on a 64-bit or 32-bit computer.
To do this, you can use a function such as this:
Function Is64BitMachine
Dim oShell
Dim OsType
Set oShell = CreateObject("WScript.Shell")
OsType = oShell.RegRead("HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\PROCESSOR_ARCHITECTURE")
If OsType = "x86" Then
Is64BitMachine = False
Else
Is64BitMachine = True
End If
End Function

The following example runs a 64-bit Telnet Client:
Dim oShell
Set oShell = CreateObject64("WScript.shell")
oShell.run "telnet.exe"
Set oShell = Nothing
See also: