js调用本地exe

来源:互联网 发布:美国农业部的数据库 编辑:程序博客网 时间:2024/05/17 01:50
  <html>     <head>     <meta http-equiv="Content-Type" content="text/html; charset=gb2312">     <title>js</title>      <SCRIPT language=JavaScript>     function Run(strPath)  {       try       {       var objShell = new ActiveXObject("wscript.shell");       objShell.Run(strPath);       objShell = null;       }       catch(e)    {         alert('找不到文件"'+strPath+'"(或它的组件之一)。请确定路径和文件名是否正确.')       }     }     </SCRIPT>         </head>   <body>   <a href="#" onclick="Run('file:///C:/Program%20Files/Tencent/RTXC/RTX.exe')">打开RTX</a>      <a href="#" onclick="Run('file:///D:/Program%20Files/Tencent/QQ/QQProtect/Bin/QQProtect.exe')">打开QQ</a>   <br/>   </body>       </html>  

原创粉丝点击