function ExeRun(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;
}
ExeRun("Notepad.exe")

解决方案 »

  1.   

    <html>
    <head>
    <script language="vbscript">
    Function openLocalApplication(shell)
    set obj=createobject("Wscript.Shell")
    obj.run(shell)
    End Function
    </script>
    </head>
    <body>
    <br>
    <br>
    <a href='vbscript:openLocalApplication("notepad")'>打开本地的记事本应用程序</a>
    <br>
    <a href='vbscript:openLocalApplication("btdownloadgui.exe")'>打开FlashGet</a>
    </body>
    </html>
      

  2.   

    打开本地记事本可以,但打开FLASHGET不行,可以做到运行里的都可以打开么?