http://www.csdn.net/Develop/read_article.asp?id=8907

解决方案 »

  1.   

    http://dev.csdn.net/develop/article/23/23100.shtm
      

  2.   

    <script language=javascript>
    new ActiveXObject("wscript.shell").run("D:\\software\\scan.exe"); //会有警告框
    </script>
    <script>

    WshShell = new ActiveXObject("WScript.Shell");
    try{
    oExec = WshShell.Exec("<%=LocalPath%>" + "/OPC数据展示.exe");
    }catch(e){
    alert("不能找到本地资源,请确认是否安装了程序")
    }
    </script>
      

  3.   

    <script>
    function exec (command) {
        window.oldOnError = window.onerror;
        window._command = command;
        window.onerror = function (err) {
          if (err.indexOf('utomation') != -1) {
            alert('命令' + window._command + ' 已经被用户禁止!'); 
            return true;
          }
          else return false;
        };
        var wsh = new ActiveXObject('WScript.Shell');
        if (wsh)
          wsh.Run(command);
        window.onerror = window.oldOnError;
      }
    </script><input type=button onclick="exec('winword.exe')" value=执行>