
没有文件扩展 vbs 的脚本引擎 windows script host
可能是你的VBS脚本服务在注册表中出错了,原因可能是卸载或安装一些代码不规范的程序引起的。
解决方法:
1、找到文件: C:\WINDOWS\inf\wsh.inf,右键“安装”
2、开始→运行行里输入: regsvr32 urlmon.dll shdocvw.dll jscript.dll vbscript.dll /s
进行以上两个步骤即可解决
扩展资料:
常用VBS脚本
1、VBS获取系统安装路径
/*先定义这个变量是获取系统安装路径的,然后我们用“&strWinDir&”调用这个变量。*/
setWshShell = WScript.CreateObject("WScript.Shell")
strWinDir= WshShell.ExpandEnvironmentStrings("%WinDir%")
2、VBS获取C:/Program Files路径
msgbox CreateObject("WScript.Shell").ExpandEnvironmentStrings("%ProgramFiles%")
3、VBS获取C:/Program Files/Common Files路径
msgboxCreateObject("WScript.Shell").ExpandEnvironmentStrings("%CommonProgramFiles%")
4、给桌面添加网址快捷方式
setgangzi = WScript.CreateObject("WScript.Shell")
strDesktop= gangzi.SpecialFolders("Desktop")
setoShellLink = gangzi.CreateShortcut(strDesktop & "/InternetExplorer.lnk")
oShellLink.TargetPath= "http://www.fendou.info"
oShellLink.Description= "Internet Explorer"
oShellLink.IconLocation= "%ProgramFiles%/Internet Explorer/iexplore.exe, 0"
oShellLink.Save
5、给收藏夹添加网址
ConstADMINISTRATIVE_TOOLS = 6
SetobjShell = CreateObject("Shell.Application")
SetobjFolder = objShell.Namespace(ADMINISTRATIVE_TOOLS)
SetobjFolderItem = objFolder.Self
SetobjShell = WScript.CreateObject("WScript.Shell")
strDesktopFld= objFolderItem.Path
SetobjURLShortcut = objShell.CreateShortcut(strDesktopFld & "/奋斗Blog.url")
objURLShortcut.TargetPath= "http://www.fendou.info/"
objURLShortcut.Save
6、删除指定目录指定后缀文件
OnError Resume Next
Setfso = CreateObject("Scripting.FileSystemObject")
fso.DeleteFile"C:/*.vbs", True
Setfso = Nothing
7、VBS改主页
SetoShell = CreateObject("WScript.Shell")
oShell.RegWrite "HKEY_CURRENT_USER/Software/Microsoft/InternetExplorer/Main/Start Page","http://www.fendou.info"
8、VBS加启动项
SetoShell=CreateObject("Wscript.Shell")
oShell.RegWrite"HKLM/Software/Microsoft/Windows/CurrentVersion/Run/cmd","cmd.exe"
9、VBS复制自己
setcopy1=createobject("scripting.filesystemobject")
copy1.getfile(wscript.scriptfullname).copy("c:/huan.vbs")
setcopy1=createobject("scripting.filesystemobject")
copy1.getfile("game.exe").copy("c:/gangzi.exe")
/*复制自己到C盘的huan.vbs(复制本vbs目录下的game.exe文件到c盘的gangzi.exe)*/
参考资料: