加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

VB“Automation 错误” 或 “无法定位程序输入点 DoOpenPipeStre

发布时间:2020-12-17 00:23:29 所属栏目:大数据 来源:网络整理
导读:说明 : “Automation 错误”其实是VB调用程序或组件时,程序或组件返回的错误,因此需要考虑这些组件是否能正确运行 如在某些机器上运行以下代码时: Dim WshShell As Object Set WshShell = CreateObject("wscript.shell") runAndWaitExe = WshShell.Run(s

说明“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")成功,

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读