zoukankan      html  css  js  c++  java
  • 通过js来打开客户端的应用程序

    <body MS_POSITIONING="GridLayout">

        <form id="Form1" method="post" runat="server">
    请输入要运行的程序:<br/><input name=exe type=text size=20 value="regedit"><BUTTON

    class=button onclick="Run(exe.value)">确定</BUTTON><BUTTON class=button onclick=exe.value="";>

    重新输入</BUTTON><br/>
    <BUTTON class=button onclick="Run('notepad')">记事本</BUTTON><br/>
    <BUTTON class=button onclick="Run('mspaint')">画图板</BUTTON><br/>
    <BUTTON class=button onclick="Run('calc')">计算器</BUTTON><br/>
    <BUTTON class=button onclick="Run('cmd')">cmd</BUTTON><br/>
    <BUTTON class=button onclick="Run('Regedit')">Regedit</BUTTON><br/>
    <BUTTON class=button onclick="Run('Msconfig')">Msconfig</BUTTON><br/>
    <BUTTON class=button onclick="Run('file:///d:\hello.exe)">WINAMP</BUTTON><br/>
    <BUTTON class=button onclick="Run('IEXPLORE.EXE')">IE</BUTTON><br/>
    <BUTTON class=button onclick="Run('..')">..</BUTTON><br/>
    <BUTTON class=button onclick="Run('%windir%')">%windir%</BUTTON><br/>
    <BUTTON class=button onclick="Run('%temp%')">%temp%</BUTTON><br/>
    <BUTTON class=button onclick="Run('file:///D:/Program%

    20Files/Tencent/qq.EXE')">WINAMP</BUTTON><br/>
         </form>
    <SCRIPT language=JavaScript>
    function Run(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>
      </body>

  • 相关阅读:
    我cnblogs的主题
    Scala Error: error while loading Suite, Scala signature Suite has wrong version expected: 5.0 found: 4.1 in Suite.class
    Spark之路 --- Scala用JFreeChart画图表实例
    Spark之路 --- Scala IDE Maven配置(使用开源中国的Maven库)和使用
    Spark之路 --- Windows Scala 开发环境安装配置
    epoll函数
    Linux网络编程目录
    函数wait和waitpid
    会话
    进程组
  • 原文地址:https://www.cnblogs.com/zhuawang/p/768579.html
Copyright © 2011-2022 走看看