例子:

<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 onclick="exec('NOTEPAD')" value="调用本地程序-记事本"><br/>
<input type=button onclick="exec('regedit')" value="调用本地程序-注册表"><br/>
<input type=button onclick="exec('explorer')" value="调用本地程序-我的文档"><br/>
<input type=button onclick="exec('calc')" value="调用本地程序-计算器"><br/>
<input type=button onclick="exec('cleanmgr')" value="调用本地程序-清理磁盘"><br/>
<input type=button onclick="exec('cliconfg')" value="调用本地程序-客户端网络实用工具"><br/>
<input type=button onclick="exec('cmd')" value="调用本地程序-DOS窗口"><br/>
<input type=button onclick="exec('cmstp')" value="调用本地程序-连接管理器配置文件"><br/>
<input type=button onclick="exec('control')" value="调用本地程序-控制面板"><br/>
<input type=button onclick="exec('cys')" value="调用本地程序-配置服务向导"><br/>
<input type=button onclick="exec('ddeshare')" value="调用本地程序-共享程序"><br/>
<input type=button onclick="exec('dvdplay')" value="调用本地程序-MidelPlay播放器"><br/>
<input type=button onclick="exec('dxdiag')" value="调用本地程序-DirectX"><br/>
<input type=button onclick="exec('licmgr')" value="调用本地程序-终端服务器授权"><br/>
<input type=button onclick="exec('mmc')" value="调用本地程序-控制台"><br/>
<input type=button onclick="exec('mobsync')" value="调用本地程序-要同步的项目"><br/>
<input type=button onclick="exec('msconfig')" value="调用本地程序-系统配置实用程序"><br/>
<input type=button onclick="exec('mspaint')" value="调用本地程序-画板工具"><br/>
<input type=button onclick="exec('msppcnfg')" value="调用本地程序-PossPort管理器管理"><br/>
<input type=button onclick="exec('mstsc')" value="调用本地程序-远程桌面连接"><br/>
<input type=button onclick="exec('nlbmgr')" value="调用本地程序-网络负荷平衡管理器"><br/>
<input type=button onclick="exec('msppcnfg')" value="调用本地程序-PossPort管理器管理"><br/>
<input type=button onclick="exec('nslookup')" value="调用本地程序-DNS查询"><br/>
<input type=button onclick="exec('odbcad32')" value="调用本地程序-ODBC数据管理器"><br/>
<input type=button onclick="exec('packager')" value="调用本地程序-对象包装程序"><br/>
<input type=button onclick="exec('rasphone')" value="调用本地程序-网络连接"><br/>
<input type=button onclick="exec('rtcshare')" value="调用本地程序-共享会话"><br/>
<input type=button onclick="exec('syskey')" value="调用本地程序-Windos账户安全"><br/>
<input type=button onclick="exec('taskmgr')" value="调用本地程序-Windos任务管理器"><br/>
<input type=button onclick="exec('winchat')" value="调用本地程序-聊天"><br/>



Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=6882

posted on 2007-09-11 17:55  小角色  阅读(760)  评论(0)    收藏  举报