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. :)