vbs 怎么编辑交换机ssh端口号
现在,在网上找了一个vbs可以批量备份交换机配置,现在就是端口没有做好,请问下面代码怎么添加端口。#$language = "VBScript"
# $interface = "1.0"
'本脚本示范:从一个文件里面自动读取设备IP地址,密码等,自动将设备配置备份
Sub Main
'打开保存设备管理地址、名称以及密码的文件
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Dim fso,file1,line,str1,params
Set fso = CreateObject("Scripting.FileSystemObject")
Set file1 = fso.OpenTextFile("E:\备份配置脚本\list.txt",Forreading, False)
crt.Screen.Synchronous = True
DO While file1.AtEndOfStream <> True
'读出每行
line = file1.ReadLine
'分离每行的参数 IP地址 密码 En密码
params = Split (line)
crt.session.LogFileName = "E:\配置备份\九月份\" & params(1) & " " & params(0) & ".txt"
crt.session.Log(true)
'SSH到这个设备上
crt.Session.Connect("/SSH2 2099 /PASSWORD "& params(3) & " " & params(2) & "@" & params(0))
'备份配置
str2 = "sc 0 t"
crt.screen.Send str2 & vbcr
str1 = "Disp cur"
crt.Screen.Send str1 & vbcr
Do Until crt.Screen.WaitForString ("---- More ----",3) = False
crt.Screen.Send " "
loop
'备份完成后退出
crt.Session.Disconnect
loop
crt.Screen.Synchronous = False
End Sub