<
html
>
< head >
< script >
function exec(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 >
</ head >
< body >
< a href ="javascript:" onclick ="exec('c:/test/sertest.exe')" > test </ a >
</ body >
</ html >
< head >
< script >
function exec(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 >
</ head >
< body >
< a href ="javascript:" onclick ="exec('c:/test/sertest.exe')" > test </ a >
</ body >
</ html >