我是Win7的系统

解决方案 »

  1.   

    location.href="xxx.exe";
    注意路径
      

  2.   

    去搜索一下FileSystemObject,不过这些都是有安全问题的,发布到web项目中可能不支持。
      

  3.   


    /******************************
    * 说明:运行Window应用程序

    * 备注:该方法只能在IE中运行,且存在较大的安全隐患,斟酌使用
    *
    * 调用示例:
    var oAppRunning = new ApplicationRunning();   
    oAppRunning.Run("C:\\Windows\\notepad.exe");
    **********************************/
    function ApplicationRunning() {
        //参数:sPath 要执行应用程序路径
        this.Run = function (sPath) {
            if (navigator.userAgent.indexOf("MSIE") <= 0) {
                alert("Sorry Meng Meng, 当前运行函数只支持IE!");
                return;
            }
            if (FileCheck(sPath, "Oh No Meng Meng!\n应用程序[" + sPath + "]不存在,请检查!!")) {
                var oWsShell = new ActiveXObject("WScript.Shell");
                if (oWsShell)
                    oWsShell.Run(sPath);
                oWsShell = null;
            }
        }
        function FileCheck(sPath, sNothingMessage) {
            try {
                var oFSO = new ActiveXObject("Scripting.FileSystemObject");
                if (!oFSO.FileExists(sPath)) {
                    oFSO = null;
                    if (sNothingMessage)
                        alert(sNothingMessage);
                    return false;
                }
                return true;        } catch (e) {
                var sErrorMessage = "命令已经被禁止!!请在IE选项的[安全]将此网站加入可信站点\n" +
                                    "并启动该自定义级别中的'对未标记为可安全执行脚本的ActiveX控件初始化并执行脚本'选项,之后刷新页面"
                alert(sErrorMessage);
                return false;
            }
        }}
      

  4.   

    需要对应的浏览器的plugin的
      

  5.   

    IE下WScript.Shell可以做到。
     但是还是跟安全设置有关。 即使低级的安全设置,执行EXE也必须用户点一次确定。
      如果都不能满足LZ要求。 建议LZ研究IE漏洞,争取发现下一个可以开网页就中毒的漏洞