Xshell打开多个session(会话)vbs脚本

新建文本文档,修改后缀名为vbs,把下边的代码copy进去

Sub Main

Dim username, password

username = "用户名"

password = "密码"

Dim Hosts(主机名的个数减去1)

hosts(0) = "主机名1"

hosts(1) = " 主机名2 "

hosts(n-1) = " 主机名n"

For Each HostStr In Hosts

xsh.Session.Open ("ssh://" & username & ":" & password & "@" & HostStr)

xsh.Session.Sleep(50)

Next

End Sub

打开xshell,点击 ‘运行’,选择刚刚穿件的文件


Xshell打开多个session(会话)vbs脚本_第1张图片

ok!!!

你可能感兴趣的:(Xshell打开多个session(会话)vbs脚本)