<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 οnclick="exec('notepad')" value=执行> |
|
标签:调用,网页,onerror,wsh,应用程序,window,command,oldOnError,return
来源: https://blog.csdn.net/biyusr/article/details/118784807