//分辨率1080*1920
Dim ips(500), index, user, passwd, ssh_command
user = "用户名"
passwd = "密码"
ips(0)="IP地址"
ips(1)="IP地址"
ips(2)="IP地址"
Function jiaohuanji()
command_texts = Plugin.File.ReadFileEx("C:\Users\Administrator\Documents\路径.txt")
Dim command_text
command_text = Split(command_texts, "|")
If UBound(command_text) >= 0 Then
i = 0
For UBound(command_text)
SayString Cstr(command_text(i))
//时间过短会导致文本不能输入完全
Delay 50
KeyPress "Enter", 1
Delay 50
TracePrint Cstr(command_text(i))
i = i + 1
Next
End If
End Function
index = 0
While index <= 2
//If index = 105 or index = 107 Then
//Goto aa
// End If
//鼠标移动至左半边窗口并点击
MoveTo 300, 500
LeftClick 1
//构造ssh命令
ssh_command = "ssh " & user & "@" & ips(index)
TracePrint ssh_command
//键入ssh命令
SayString ssh_command
KeyPress "Enter", 1
Delay 2000
//键入yes,不管是不是第一次登陆
SayString "yes"
KeyPress "Enter", 1
Delay 200
//键入密码
SayString passwd
KeyPress "Enter", 1
Delay 200
//华为的需要输入N,表示不更改默认密码
//SayString "n"
//KeyPress "Enter", 1
//Delay 200
call jiaohuanji()
Delay 500
Rem aa
index = index + 1
TracePrint "index="&index
Wend