View Single Post
  #3  
Old 06-13-2016, 02:56 PM
pcdocta pcdocta is offline
Registered User
 
Join Date: Jun 2016
Posts: 1
Have you tried adding:

crt.Screen.WaitForString "#"

after each line that sends a command?
Since these commands are on cisco gear, what you need to wait for is the # character, then each command will do its things and move on to the next line..

see below...

Code:
# $language = "VBScript"
# $interface = "1.0"

Sub Main
crt.Screen.Synchronous = True
crt.Session.Connect "/TELNET x.x.x.x 23"
crt.Screen.WaitForString "sername:"
crt.Screen.Send "xxx" & vbCr
crt.Screen.WaitForString "assword:"
crt.Screen.Send "xxx" & vbCr

crt.Screen.Send "show ip int br" & vbCr
crt.Screen.WaitForString "#"
crt.Screen.Send "show cdp neighbors" &vbCr
crt.Screen.WaitForString "#"
crt.Screen.Send "ping 8.8.8.8" & vbCr
crt.Screen.WaitForString "#"

crt.Screen.Synchronous = False

msgbox("Done")

End Sub

Last edited by jdev; 12-13-2016 at 11:32 AM.
Reply With Quote