无法在Windows 7 64位系统使用的CreateObject从VB脚本 [英] Cannot use CreateObject from VB scripts on Windows 7 x64

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

问题描述

当我尝试在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'code: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.

有什么办法,使这个?

推荐答案

VBScript的跨preTER(的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.

您可以找到32位版本的%WINDIR%\ Syswow64资料文件夹。启动这个版本应该给你访问所有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%\SysWOW64\wscript.exe myScript.vbs

%windir%\SysWOW64\cscript.exe myScript.vbs

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

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