按键精灵批量处理

//分辨率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

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值