微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

VB“Automation 错误” 或 “无法定位程序输入点 DoOpenPipeStream 于动态链接库ScrRun.dll上”

说明“Automation 错误”其实是VB调用程序或组件时,程序或组件返回的错误,因此需要考虑这些组件是否能正确运行

如在某些机器上运行以下代码时:

会产生“AutoMation 错误”,原因是"Wscript.Shell"无法正常运行

-------------------------------------------------------------------------------------------------------------------------

以下方法转自网络,已经成功地解决问题!

错误消息和前面的一样“WSript.exe - 无法找到入口 ”,无法创建名为“Wscript.Shell”的对象。于是开始了疯狂百度,原因是说要么脚本被禁用(不可能,因为弹出消息来了嘛),二是文件被改动。网上一般是说注册两个组件就OK了,如下:

regsvr32 srcrun.dll (命令成功)
regsvr32 wshom.ocx (弹出错误提示:无法定位程序输入点 DoOpenPipestream 于动态链接库ScrRun.dll上)一个执行成功,后一个怎么弄都是错误,消息是“LoadLibary("wshom")失败,找不到指定的程序”,看了看system32目录下,wshom.ocx是有的。后来开始认识到可能是wshom.ocx被破坏了,于是找了相同版本的电脑(我的是XP SP3),然后写段脚本,把下面的文件拷出来:mkdir c:/repairset source=%windir%/system32set target=c:/repaircopy %source%/cscript.exe %target%copy %source%/jscript.dll %target%copy %source%/scrobj.dll %target%copy %source%/scrrun.dll %target%copy %source%/vbscript.dll %target%copy %source%/wscript.exe %target%copy %source%/wshext.dll %target%copy %source%/wshom.ocx %target%pause并将对方机器上的c:/repair目录拷贝到我的c:/下,然后用下列脚本更新:set source=c:/repairset target=%windir%/system32copy %source%/cscript.exe %target%copy %source%/jscript.dll %target%copy %source%/scrobj.dll %target%copy %source%/scrrun.dll %target%copy %source%/vbscript.dll %target%copy %source%/wscript.exe %target%copy %source%/wshext.dll %target%copy %source%/wshom.ocx %target%regsvr32 %target%/jscript.dllregsvr32 %target%/scrobj.dllregsvr32 %target%/scrrun.dllregsvr32 %target%/vbscript.dllregsvr32 %target%/wshext.dllregsvr32 %target%/wshom.ocxpause完成后使用脚本测试CreateObject("WScript.Shell")成功,

原文地址:https://www.jb51.cc/vb/261145.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐