secure CRT脚本使用

找了好多的secure CRT脚本,都不怎么好用,这个脚本也是某个大咖写的,测试的时候用过一次可以正常备份配置,后面在测试就一直报错,有没有懂技术的大咖看下,是哪里错了,一直报错20行。


#$language = "VBScript"
#$interface = "1.0"
crt.Screen.Synchronous = True
Sub Main
Const ForReading = 1
ForWriting = 2
ForAppending = 8
Dim wordkey
Dim fso
Dim file1
Dim line
Dim params
Set fso = CreateObject("Scripting.FileSystemObject")
Set file1=fso.OpenTextFile("E:\Crt配置\list.txt",ForReading,False)
'文件格式:ip 用户名 密码 设备名
While file1.AtEndOfStream <> True
'逐行读取该文件
line = file1.ReadLine
params = Split (line)
crt.Session.Connect "/telnet" & " " & params(0)
'等效 telnet ip地址 23
crt.Session.LogFileName = "E:\Crt配置\" & params(3) &  ".txt"
crt.Session.Log True
wordkey = crt.Screen.WaitForStrings ("username:","login:","Username:",3)  '3秒内根据登录提示来选择 
Select case wordkey
case 1
crt.Screen.Send params(1) & chr(13)
crt.Screen.WaitForString "PASSCODE:"
crt.Screen.Send params(2) & chr(13)
crt.Screen.WaitForString "#"
crt.Screen.Send "show run" & chr(13)
While (crt.Screen.WaitForString("--More--",3)= true)
crt.Screen.Send " "
wend
case 2
crt.Screen.Send params(1) & chr(13)
crt.Screen.WaitForString "Password: "
crt.Screen.Send params(2) & chr(13)
crt.Screen.WaitForString ">"
crt.Screen.Send "dis cu" & chr(13)
While (crt.Screen.WaitForString("---- More ----",3)= true)
crt.Screen.Send " " 
wend
case 3
crt.Screen.Send params(1) & chr(13)
crt.Screen.WaitForString "Password:"
crt.Screen.Send params(2) & chr(13)
crt.Screen.WaitForString ">"
crt.Screen.Send "dis cu" & chr(13)
While (crt.Screen.WaitForString("---- More ----",3)= true)
crt.Screen.Send " "
wend
End Select
crt.Session.Disconnect
wend
crt.Screen.Synchronous = False
End Sub

img


错误是20行,看看20行写错了什么