MSXML4.0 on Windows Server 2008r2 - Cannot create object MSXML2.ServerXMLHTTP.4.0

4.9k views Asked by At

We have a large codebase (primarily vbscript) that I am migrating from a Windows 2000 (32 bit) server to Windows 2008 R2 (64 bit). A good portion of this code relies on the MSXML 4.0 parser and unfortunately, we do not have the option of using version 3 or 6 (for reasons beyond the scope of this question).

I've installed the 4.0 version of MSXML as per the instructions at http://www.microsoft.com/en-us/download/details.aspx?id=15697 and verified that it installed correctly. "msxml4.dll" exists in "c:\windows\syswow64" and there is a key in the registry at HKEY_CLASSES_ROOT\Msxml2.ServerXMLHTTP.4.0 . I even ran regsrv32.exe against the dll and it said the it was registered correctly.

However, when trying to do

    Set objAsp = CreateObject("MSXML2.ServerXMLHTTP.4.0")

It fails with:

    Script: C:\test.vbs
    Line:   1
    Char:   1
    Error:  ActiveX component can't create object: 'MSXML2.ServerXMLHTTP.4.0'
    Code:   800A01AD
    Source:     Microsoft VBScript runtime error

And in powershell:

     $objAsp = New-Object -ComObject MSXML2.ServerXMLHTTP.4.0

it fails with:

    New-Object : Retrieving the COM class factory for component with CLSID {88D969C6-
    F192-11D4-A65F-0040963251E5} failed due to the following error: 80040154 Class not   
    registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
    At line:1 char:11
    + $objAsp = New-Object -ComObject MSXML2.ServerXMLHTTP.4.0
    +           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (:) [New-Object], COMException
    + FullyQualifiedErrorId :  
    NoCOMClassIdentified,Microsoft.PowerShell.Commands.NewObjectCommand

Thanks in advance.

1

There are 1 answers

0
Simon Mourier On

I think you're running the 64-bit versions of CScript and Powershell by default, but MSXML is a 32-bit component.

Here is a link that explain how to start the 32-bit version of Powershell on a 64-bit OS: Starting the 32-Bit Version of Windows PowerShell