ActiveX component can't create object, when creating a 32-COM object in a 64-bit machine
I had two posts to resolve an issue with applications that use a 32-bit COM object in a 64-bit OS. Workaround for executable, and ASP.Net.
I recently helped someone who had the same problem, but with a VB Script application, executed with cscript.exe. This VB script application uses a 32-bit COM object and failed to run on a 64-bit OS. The error, Microsoft VBScript runtime error: ActiveX component can't create object: 'XXXXXX'.
To fix the issue, the script must be executed with the right executable. There are two cscript.exe in the 64-bit OSes. One is located at %WINDOWS%\System32, and the second one is located at %WINDOWS%\SysWOW64.
The one under System32, is a 64-bit version. The one under SysWOW64 is the 32-bit version. Run the VBS application using the 32-bit application.
Why System32 contains 64-bit binaries, and SysWOW64 contains 32-bit is another story, but there is a very good reason behind it, backward compatibility. :)
Comments
Anonymous
November 14, 2008
Nice one, thanks -- had us stumped for a bit. I guess "System32" was an unfortunate choice of names. --BrettAnonymous
April 01, 2009
> Why System32 contains 64-bit binaries, and SysWOW64 contains 32-bit is another story, but there is a very good reason behind it, backward compatibility. :) Seems consistent with Microsoft's other conventions, like selecting "Start" to shutdown your computer.Anonymous
April 02, 2009
@Lonnie You turned the ignition key to shut off you car. :) It was based on usability. http://blogs.msdn.com/oldnewthing/archive/2003/07/22/54559.aspxAnonymous
June 04, 2009
Thanks for the info. I have an additional question. If you run the script from a 32-bit 2003 server and it has to interact with a DC that is on a 2008 server what do you need to do to get it to work then?Anonymous
June 05, 2009
@Joacim: I am not sure, but I think that should be fine.Anonymous
June 07, 2009
Well it doesn't for some reason. I guess you somehow have to point it to the %WINDOWS%SysWOW64 catalogue in the script. I assume that %WINDOWS%System32 would be default on the 2008 64-bit machine, or should it be able to identify that automatically?Anonymous
June 30, 2009
@Joacim: You have to point to %WINDOWS%SysWOW64. That folder contains 32-bit images. %WINDOWS%System32 contains 64-bit images, and it is the default.Anonymous
October 01, 2009
The comment has been removedAnonymous
February 16, 2010
Thanks! Spent quite a while on this one. Had me stumped.Anonymous
June 22, 2010
The comment has been removed