美文网首页
在Windows中运行js

在Windows中运行js

作者: 九歌丶 | 来源:发表于2020-01-17 15:54 被阅读0次
// 同时打开两个应用程序
var sh = WScript.CreateObject("WScript.Shell"); 
var path = [
    "\"C:\\Program Files (x86)\\DingDing\\DingtalkLauncher.exe\"",
    "\"C:\\Program Files (x86)\\Tencent\\WeChat\\WeChat.exe\""
]

try {
    for(var i = 0; i < path.length; i++){
        sh.run(path[i]); 
    }
} catch(e) {
    WScript.echo(e);
}
// ssh自动输入密码连接
var sh = WScript.CreateObject("WScript.Shell");
var username = "manson",
    password = "manson",
    host = "127.0.0.1",
    port = "22";

sh.run("ssh " + username + "@" + host + " -p " + port);

WScript.sleep(500);
sh.appActivate("OpenSSH");
sh.sendKeys(password + "{Enter}{Enter}");

更多精彩

相关文章

网友评论

      本文标题:在Windows中运行js

      本文链接:https://www.haomeiwen.com/subject/xmoczctx.html