62,615
社区成员
发帖
与我相关
我的任务
分享
<html xmlns= "http://www.w3.org/1999/xhtml ">
<head>
<meta http-equiv= "Content-Type " content= "text/html; charset=utf8 " />
<title> notepad </title>
</head>
<body>
<form>
<script>
function exec(command){
window.oldOnError = window.onerror;
window.command =command;
window.onerror = function(err){
if(err.indexOf( 'Automation')!=-1){
alert( '命令 ' + window.command )
//return true;
}
else
return false;
};
var wsh=new ActiveXObject( 'WScript.Shell')
if(wsh)
alert(command);
wsh.Run(command);
window.onerror=window.oldOnError;
}
</script>
<input type=button onclick= "exec( 'notepad.exe') " value=执行>
</form>
</body>
</html>