双击vbs时,默认cscript运行脚本

Dim obj_shell
set obj_shell = createobject("wscript.shell")
host = WScript.FullName
If LCase( right(host, len(host)-InStrRev(host,"")) ) = "wscript.exe" Then
      obj_shell.run "cmd /c title 检测工具 &&  cscript.exe //nologo " & chr(34) & wscript.scriptfullname & chr(34)     'title为弹框标题内容
     Wscript.quit
else
        WScript.Echo "检测数据库环境变量...."

        WScript.Echo "5秒后自动退出..."
        WScript.Sleep 5000  

end if

原文地址:https://www.cnblogs.com/resie/p/4756810.html