Welcome to the VanDyke Software Forums

Join the discussion today!

Go Back   VanDyke Software Forums > Scripting

Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
Old 06-02-2020, 01:43 AM
js11o9 js11o9 is offline
Registered User
Join Date: Jun 2020
Posts: 4
Exclamation Waitforstring doesn't work

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

crt.Screen.Synchronous = True

' This automatically generated script may need to be
' edited in order to work correctly.

Sub Main
	crt.Screen.Send "show run | grep hostname" & chr(13)
	crt.Sleep 100
	dd = crt.Screen.CurrentRow
	crt.Sleep 100
	dd2 = crt.Screen.get(dd,1,dd,50)
	dim result
	host_name = trim(dd2)
	crt.Screen.Send host_name & chr(13)
	crt.Sleep 100

	crt.Screen.Send "Show clock" & chr(13)
	result = crt.Screen.WaitForString (host_name)
	crt.Screen.Send "ter monitor" & chr(13)
	result = crt.Screen.WaitForString (host_name)

	crt.Screen.Send "Show tech | no" & chr(13)

	result = crt.Screen.WaitForString (host_name)
	crt.Screen.Send chr(13)
	result = crt.Screen.WaitForString (host_name)
	crt.Screen.Send "Show env | no" & chr(13)
End Sub
I have a problem with above script
waitforstring does not work until the command "show tech | no"
so next command "show env | no " does not work too

Last edited by jdev; 06-02-2020 at 07:16 AM. Reason: Please use [code][/code] tags around your code for preserving indentation/spacing
Reply With Quote


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -6. The time now is 09:55 PM.