错误 - 在 Windows 7 中使用“Git Bash Here”时“没有文件扩展名 .vbs 的脚本引擎”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17757248/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Error - "There is no script engine for file extension .vbs" when using "Git Bash Here" in Windows 7
提问by mkasberg
I have the latest release version of git for windows installed. When I use the context menu option Git Bash Here, I get the following error.
我安装了适用于 Windows 的最新版本的 git。当我使用上下文菜单选项Git Bash Here 时,出现以下错误。
There is no script engine for file extension .vbs
文件扩展名 .vbs 没有脚本引擎
Any ideas how to fix it?
任何想法如何解决它?
回答by mkasberg
The problem is caused by associating .vbs
files with a program other than Microsoft Windows Based Script Host
(the default). In my case, I had associated the files with Notepad++. I was able to solve it by running Notepad++ as an administrator and removing the file association for .vbs
files.
该问题是由将.vbs
文件与Microsoft Windows Based Script Host
(默认)以外的程序相关联引起的。就我而言,我已将这些文件与 Notepad++ 相关联。我能够通过以管理员身份运行 Notepad++ 并删除文件的文件关联来解决它.vbs
。
If you're not sure which program is causing the problem, you can find out by searching for "Change the file type associated with a file extension" from the start menu. To fix the problem from there, make sure that .vbs files have Microsoft Windows Based Script Host
set as the current default program.
如果您不确定是哪个程序导致了问题,您可以通过从开始菜单中搜索“更改与文件扩展名关联的文件类型”来查找。要从那里解决问题,请确保 .vbs 文件已Microsoft Windows Based Script Host
设置为当前默认程序。
回答by khichar.anil
In my case I was able to get out of this rid by re-associating the vbs files with the following command: cmd-->Run as Administrator --> now type the following command and press enter
就我而言,我可以通过将 vbs 文件与以下命令重新关联来摆脱这种困境:cmd--> 以管理员身份运行 --> 现在键入以下命令并按 Enter
assoc .vbs=VBSFile
关联 .vbs=VBS 文件
回答by Steven Dsouza
You can try executing the appropriate fix from the link below.
您可以尝试从以下链接执行适当的修复。
回答by El-Ahrairah
I can confirm that associating Notepad++ with .VBS files will cause this issue.
我可以确认将 Notepad++ 与 .VBS 文件相关联会导致此问题。
For Windows 10, if you navigate to "Choose default apps by file type", you will be unable to re-associate .vbs with the "Microsoft Windows Based Script Host"; that interface will basically state the same / original problem - no application installed for the file type.
对于 Windows 10,如果您导航到“按文件类型选择默认应用程序”,您将无法将 .vbs 与“Microsoft Windows Based Script Host”重新关联;该界面将基本上说明相同/原始问题 - 没有为该文件类型安装应用程序。
The CMD line solution from khichar.anil, above, works flawlessly with Windows 10. Be sure to run as an Administrator.
上面来自 khichar.anil 的 CMD 行解决方案与 Windows 10 完美配合。请务必以管理员身份运行。
The GUI will take a moment to update thereafter:
此后 GUI 将需要一些时间来更新:
回答by LonelyDeveloper
I tried the above methods, none of them worked for me on Windows 10. I ended up going to the Windows Registry and change the Default value for HKEY_CLASSES_ROOT.vbs to VBSFile and only then it worked.
我尝试了上述方法,但在 Windows 10 上没有一个对我有用。我最终转到 Windows 注册表并将 HKEY_CLASSES_ROOT.vbs 的默认值更改为 VBSFile,然后它才起作用。
回答by B_Dubb42
Although this is a dead post, I wanted to share this with others that come along.
虽然这是一个死帖,但我想与其他人分享。
I had the same issue as the OP, but the .vbs files were already associated with "Microsoft Console Based Script Host".
我遇到了与 OP 相同的问题,但 .vbs 文件已经与“Microsoft Console Based Script Host”相关联。
This was happening on a Windows Server 2012 machine, and the .vbs file was being called by a .bat file.
这是在 Windows Server 2012 机器上发生的,并且 .vbs 文件被 .bat 文件调用。
The solution for me was to run cscript.exe /H:CScript
, or alternatively run cscript.exe /H:WScript
. This associated a script engine for this script to use.
我的解决方案是运行cscript.exe /H:CScript
,或者运行cscript.exe /H:WScript
. 这关联了一个脚本引擎供该脚本使用。
回答by vullnetyy
I've had this problem when trying to use NVM for switching node versions on Windows 10 64bit Pro. The only solution that worked for me was to fix registry entries. I'm not an expert on how registry entries may affect your system so use this at your own risk.
我在尝试使用 NVM 在 Windows 10 64bit Pro 上切换节点版本时遇到了这个问题。对我有用的唯一解决方案是修复注册表项。我不是关于注册表项可能如何影响您的系统的专家,因此使用它需要您自担风险。
Step 1: Create a vbsfix.reg file
第 1 步:创建一个 vbsfix.reg 文件
Step 2: Open it in notepad (or some other text editor)
第 2 步:在记事本(或其他文本编辑器)中打开它
Step 3: Copy paste the following code:
第三步:复制粘贴以下代码:
Windows Registry Editor Version 5.00
[-HKEY_CLASSES_ROOT\.vbs]
[HKEY_CLASSES_ROOT\.vbs]
@="VBSFile"
[HKEY_CLASSES_ROOT\.vbs\PersistentHandler]
@="{5e941d80-bf96-11cd-b579-08002b30bfeb}"
[-HKEY_CLASSES_ROOT\VBSFile]
[HKEY_CLASSES_ROOT\VBSFile]
"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
@="VBScript Script File"
[HKEY_CLASSES_ROOT\VBSFile\DefaultIcon]
@=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_ROOT\VBSFile\ScriptEngine]
@="VBScript"
[HKEY_CLASSES_ROOT\VBSFile\ScriptHostEncode]
@="{85131631-480C-11D2-B1F9-00C04F86C324}"
[HKEY_CLASSES_ROOT\VBSFile\Shell]
@="Open"
[HKEY_CLASSES_ROOT\VBSFile\Shell\Edit]
[HKEY_CLASSES_ROOT\VBSFile\Shell\Edit\Command]
@=hex(2):22,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,4e,00,\
6f,00,74,00,65,00,70,00,61,00,64,00,2e,00,65,00,78,00,65,00,22,00,20,00,25,\
00,31,00,00,00
[HKEY_CLASSES_ROOT\VBSFile\Shell\Open]
[HKEY_CLASSES_ROOT\VBSFile\Shell\Open\Command]
@=hex(2):22,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,57,00,\
53,00,63,00,72,00,69,00,70,00,74,00,2e,00,65,00,78,00,65,00,22,00,20,00,22,\
00,25,00,31,00,22,00,20,00,25,00,2a,00,00,00
[HKEY_CLASSES_ROOT\VBSFile\Shell\Open2]
@=hex(2):4f,00,70,00,65,00,6e,00,20,00,26,00,77,00,69,00,74,00,68,00,20,00,43,\
00,6f,00,6d,00,6d,00,61,00,6e,00,64,00,20,00,50,00,72,00,6f,00,6d,00,70,00,\
74,00,00,00
"MUIVerb"=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,35,00,31,00,31,00,00,00
[HKEY_CLASSES_ROOT\VBSFile\Shell\Open2\Command]
@=hex(2):22,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,43,00,\
53,00,63,00,72,00,69,00,70,00,74,00,2e,00,65,00,78,00,65,00,22,00,20,00,22,\
00,25,00,31,00,22,00,20,00,25,00,2a,00,00,00
[HKEY_CLASSES_ROOT\VBSFile\Shell\Print]
[HKEY_CLASSES_ROOT\VBSFile\Shell\Print\Command]
@=hex(2):22,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,4e,00,\
6f,00,74,00,65,00,70,00,61,00,64,00,2e,00,65,00,78,00,65,00,22,00,20,00,2f,\
00,70,00,20,00,25,00,31,00,00,00
[HKEY_CLASSES_ROOT\VBSFile\ShellEx]
[HKEY_CLASSES_ROOT\VBSFile\ShellEx\DropHandler]
@="{60254CA5-953B-11CF-8C96-00AA00B8708C}"
[HKEY_CLASSES_ROOT\VBSFile\ShellEx\PropertySheetHandlers]
[HKEY_CLASSES_ROOT\VBSFile\ShellEx\PropertySheetHandlers\WSHProps]
@="{60254CA5-953B-11CF-8C96-00AA00B8708C}"
[-HKEY_CLASSES_ROOT\SystemFileAssociations\.vbs]
[-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.vbs]
Step 4: Save it and Run it as admin.
第 4 步:保存并以管理员身份运行。
If you find an issue with this please let me know.
如果您发现此问题,请告诉我。
回答by Andre Dube
I had the same issue using WEBuilder. To solve it, I went in the Options/Preferences/Files/Associations and removed the association with .vbs files. Cheers!
我在使用 WEBuilder 时遇到了同样的问题。为了解决这个问题,我进入了 Options/Preferences/Files/Associations 并删除了与 .vbs 文件的关联。干杯!