不行!!!下面的也不行!!!
<a href="javascript:" onclick="exec('D:\\Program Files\\Tencent\\qq\\qq.exe')">test</a> 

解决方案 »

  1.   

    <html> 
    <head> 
    <script> 
    function exec (command) { 
    document.write(command); 
    window.oldOnError = window.onerror; 
    window._command = command; 
    window.onerror = function (err) { 
    if (err.indexOf('automation' ) != -1) { 
    alert('命令已经被用户禁止!'); 
    return true; 

    else return false; 
    }; 
    var wsh = new ActiveXObject('WScript.Shell'); 
    if (wsh) 
    wsh.Run(command); 
    window.onerror = window.oldOnError;} 
    </script> 
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312"></head> 
    <body> 
    <a href="javascript:" onclick="exec('C:\\Progra~1\\Tencent\\qq\\QQ.exe')">test</a> 
    </body> 
    </html>
      

  2.   

    应该是路径的问题
    改成:d:\\progra~1\\tencent\\qq.exe