View Single Post
  #7  
Old 03-22-2012, 09:32 AM
djacoby djacoby is offline
Registered User
 
Join Date: Nov 2011
Posts: 14
UGH!!!

I added one more thing to my script to basically skip the rest of the process if the attempt to telnet times out and now it is not copying the config again. Result = 2, killing the loop before it starts.

crt.Screen.Send "telnet " & ipadd & chr(13)

Timeout = crt.Screen.WaitForStrings( "login:" )

If Timeout = 1 Then

crt.Screen.Send "admin" & chr(13)
crt.Screen.WaitForString "Password:"
crt.Screen.Send "*****" & chr(13)
crt.Screen.WaitForString ">"
crt.Screen.Send "en" & chr(13)
crt.Screen.WaitForString "Password:"
crt.Screen.Send "*****" & chr(13)
crt.Screen.Send "no cli-paging " & Chr(13)
crt.Screen.Send "sh run" & chr(13)
crt.Screen.WaitForString Chr(10)
crt.Screen.WaitForString Chr(10)


I put the End If at the end of the Do Loop at the bottom of the script.
Reply With Quote