• js调取本地可执行文件exe


    通过ie支持的activex控件来读取文程序的安装路径,从而调用本地exe文件

    function callExe () {
    try{
    var command;
    var shell = new ActiveXObject("WScript.Shell");
    command = shell.RegRead("HKEY_CURRENT_USER\SOFTWARE\Tencent\WeChat\InstallPath");//从注册表获得软件安装路径
    command = command + "\WeChat.exe";
    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;
    }catch(e){
    alert(e);
    }
    }

  • 相关阅读:
    MS-data
    Lammps命令与in文件
    VMD建模得到模型
    VMD-合并模型与生成data文件
    VMD-水溶液中注入离子
    水分子模型
    1.MD相关概念
    Python7
    python6
    python5
  • 原文地址:https://www.cnblogs.com/xzsty/p/6741967.html
Copyright © 2020-2023  润新知