var wsh = new ActiveXObject("wscript.shell")http://community.csdn.net/Expert/topic/3340/3340495.xml?temp=.216305

解决方案 »

  1.   

    <%@ Language=VBScript %>
    <HTML>
    <HEAD>
    <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
    <SCRIPT LANGUAGE=javascript>
    <!--
    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></HEAD>
    <BODY>
    <input type=button onclick="exec('notepad')" value=寫字板 id=button1 name=button1>
    <input type=button onclick="exec('cmd')" value=DOS模式 id=button1 name=button1>
    <input type=button onclick="exec('edit')" value=EDIT模式 id=button1 name=button1>
    <input type=button onclick="exec('write')" value=write模式 id=button1 name=button1>
    <input type=button onclick="exec('mem')" value=mem模式 id=button1 name=button1>
    <input type=button onclick="exec('btree2')" value=btree2模式 id=button1 name=button1>
    <input type=button onclick="exec('syskey')" value=syskey模式 id=button1 name=button1>
    <P>&nbsp;</P></BODY>
    </HTML>