无法在 Windows 7 x64 上使用来自 VB 脚本的 CreateObject [英] Cannot use CreateObject from VB scripts on Windows 7 x64

查看:23
本文介绍了无法在 Windows 7 x64 上使用来自 VB 脚本的 CreateObject的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试在 Windows 7(64 位)机器上用 VB 脚本创建 COM 对象时,总是出现以下错误:

When I try to create a COM object in VB script on a Windows 7 (64 bit) machine, I always get the following error:

"ActiveX 组件无法创建对象 'xxx.xxx'.代码:800A01AD

"ActiveX component can't create object 'xxx.xxx'. Code: 800A01AD

我有使用 COM 对象的应用程序没有任何问题.我试过在管理员模式下运行命令行,没有区别.

I have applications that use the COM object without any problem. I have tried running the command line in admin mode, no difference.

有什么办法可以启用此功能吗?

Is there any way to enable this?

推荐答案

VBScript 解释器 (cscript.exe/wscript.exe) 在 64 位版本的 Windows 上有两种版本:32 位版本和 64 位版本-位版本.

The VBScript interpreter (cscript.exe/wscript.exe) comes in two flavors on a 64-bit version of Windows: a 32-bit version and a 64-bit version.

32 位版本只能创建和使用 32 位 COM 组件,64 位版本只能创建和使用 64 位 COM 组件.

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

默认情况下,.vbs 文件与 64 位版本相关联.您的 COM 组件很可能是 32 位的,因此会出现错误.

By default, .vbs files are associated with the 64-bit version. You COM component is most likely a 32-bit one, hence the error.

您可以在 %windir%SysWOW64 文件夹中找到 32 位版本.启动此版本应该可以让您访问所有 32 位 COM 组件:

You can find the 32-bit version in the %windir%SysWOW64 folder. Launching this version should give you access to all 32-bit COM components:

%windir%SysWOW64wscript.exe myScript.vbs

%windir%SysWOW64cscript.exe myScript.vbs

这篇关于无法在 Windows 7 x64 上使用来自 VB 脚本的 CreateObject的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆