View Single Post
Old 06-04-2016, 03:08 AM
mehbooburrehman mehbooburrehman is offline
Registered User
Join Date: Jun 2016
Posts: 2
Make Secure CRT script wait till command finished

When I use VBS to run command on a device my script keeps running through commands until the end without waiting for previous device command to finish.

for example in the following script. The commands on the router take a few seconds to execute but the last command "msgbox("done") is executed immediately.

Is there any way to make the script wait till the commands are executed.

# $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 "sl@x" & vbCr

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

crt.Screen.Synchronous = False


End Sub
Reply With Quote