无法找到脚本*.VBS的脚本引擎解决办法

当你在运行一些基于VBS脚本语言的文件时,系统可能报错。这时候可能是你的VBS脚本服务在注册表中出错了,原因可能是卸载或安装一些代码不规范的程序引起的。这里给出无法找到脚本引擎"vbscript"的解决方法:

把以下代码复制另存为《vbs关联修复.reg》,双击运行即可。

原因是vbs文件没有正常关联,要建立关联,主要有三个地方要修改。

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT.vbs]
@="vbsfile"

[HKEY_CLASSES_ROOT.vbsPersistentHandler]
@="{5e941d80-bf96-11cd-b579-08002b30bfeb}"


[HKEY_CLASSES_ROOTVBSFile]
@="VBScript Script 文件"
"FriendlyTypeName"=hex(2):40,00,25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,
00,6f,00,6f,00,74,00,25,00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,
32,00,5c,00,77,00,73,00,68,00,65,00,78,00,74,00,2e,00,64,00,6c,00,6c,00,2c,
00,2d,00,34,00,38,00,30,00,32,00,00,00

[HKEY_CLASSES_ROOTVBSFileDefaultIcon]
@=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,
00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,57,00,53,00,
63,00,72,00,69,00,70,00,74,00,2e,00,65,00,78,00,65,00,2c,00,32,00,00,00

[HKEY_CLASSES_ROOTVBSFileScriptEngine]
@="VBScript"

[HKEY_CLASSES_ROOTVBSFileScriptHostEncode]
@="{85131631-480C-11D2-B1F9-00C04F86C324}"

[HKEY_CLASSES_ROOTVBSFileShell]

[HKEY_CLASSES_ROOTVBSFileShellEdit]
@="编辑(&E)"

[HKEY_CLASSES_ROOTVBSFileShellEditCommand]
@=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,
00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,4e,00,6f,00,
74,00,65,00,70,00,61,00,64,00,2e,00,65,00,78,00,65,00,20,00,25,00,31,00,00,
00

[HKEY_CLASSES_ROOTVBSFileShellOpen]
@="打开(&O)"

[HKEY_CLASSES_ROOTVBSFileShellOpenCommand]
@=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,
00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,57,00,53,00,
63,00,72,00,69,00,70,00,74,00,2e,00,65,00,78,00,65,00,20,00,22,00,25,00,31,
00,22,00,20,00,25,00,2a,00,00,00

[HKEY_CLASSES_ROOTVBSFileShellOpen2]
@="在命令提示符中打开(&W)"

[HKEY_CLASSES_ROOTVBSFileShellOpen2Command]
@=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,
00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,43,00,53,00,
63,00,72,00,69,00,70,00,74,00,2e,00,65,00,78,00,65,00,20,00,22,00,25,00,31,
00,22,00,20,00,25,00,2a,00,00,00

[HKEY_CLASSES_ROOTVBSFileShellPrint]
@="打印(&P)"

[HKEY_CLASSES_ROOTVBSFileShellPrintCommand]
@=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,
00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,4e,00,6f,00,
74,00,65,00,70,00,61,00,64,00,2e,00,65,00,78,00,65,00,20,00,2f,00,70,00,20,
00,25,00,31,00,00,00

[HKEY_CLASSES_ROOTVBSFileShellEx]

[HKEY_CLASSES_ROOTVBSFileShellExDropHandler]
@="{60254CA5-953B-11CF-8C96-00AA00B8708C}"

[HKEY_CLASSES_ROOTVBSFileShellExPropertySheetHandlers]

[HKEY_CLASSES_ROOTVBSFileShellExPropertySheetHandlersWSHProps]
@="{60254CA5-953B-11CF-8C96-00AA00B8708C}"

 也有可能是动态链接库没有注册,这个可能性很小。用以下批处理解决:《注册vbscript.bat》

regsvr32 %systemroot%system32vbscript.dll
regsvr32 scrrun.dll
regsvr32 cscript.dll
regsvr32 wshom.ocx
regsvr32 wshext.dll

《vbs测试.vbs》能运行这个就证明OK了!

msgbox "Hello world!"

原文地址:https://www.cnblogs.com/liuzhaoyzz/p/4329488.html