由于我们设备比较多.局方因为安全原因.所以多采用了跨多网元的跳转方式.现在备记如下secure crt auto login script.:
首个登陆的网元ip配置在secure crt的会话选项/连接/telnet中.
下面采用以下脚本逐次跳转的脚本(到我们的设备)
pdsn.vbs ---script. name for logining in device
# $language = "VBScript"
# $interface = "1.0"
Sub Main
crt.screen.WaitForString "Username:" ---提示符 Username:
crt.screen.Send "x" & VbCr ---& VbCr 表示换行符
crt.screen.WaitForString "Password:" ---waitfor表示系统的提示
crt.screen.Send "y" & VbCr --send表示输入的东西
crt.screen.WaitForString ""
crt.screen.Send "telnet 1.*.*.*" & VbCr
crt.screen.WaitForString "login:" --waitfor 系统提示可能只是右边一部分也可以提示整个一行
crt.screen.Send "root" & VbCr
crt.screen.WaitForString "Password:"
crt.screen.Send "fcnn1112" & VbCr
End Sub
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/9240380/viewspace-571485/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/9240380/viewspace-571485/