Welcome to the VanDyke Software Forums

Join the discussion today!

Go Back   VanDyke Software Forums > Scripting

Thread Tools Rate Thread Display Modes
Old 03-20-2017, 12:52 AM
yardian yardian is offline
Registered User
Join Date: Jun 2014
Posts: 2
Question sto

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

' This script demonstrates how ActiveX scripting can be used to
' interact with CRT and manipulate other programs such as Microsoft Excel
' through an OLE automation interface. This script creates an instance of Excel,
' then it sends a command to a remote server (assuming we're already
' connected). It reads the output, parses it and writes out some of the
' data to an Excel spreadsheet and saves it. This script also demonstrates
' how the WaitForStrings function can be used to wait for more than one
' output string.

Sub main
'crt.Screen.IgnoreCase = True
crt.screen.synchronous = true

' Create an Excel workbook/worksheet
Dim app, wb, ws
Set app = CreateObject("Excel.Application")
Set wb = app.Workbooks.Add
Set ws = wb.Worksheets(1)

' Send the initial command to run and wait for the first linefeed

crt.Screen.Send("dis mac-address dynamic vlan 3000" & Chr(10) )

do While true
if (crt.Screen.WaitForString("More",3) = true ) then
crt.Screen.Send(" ")
crt.Sleep 3000
exit do
end if

crt.Screen.WaitForString Chr(10)

crt.screen.synchronous = false
End Sub

vbs untils stopping do while,please help me,ths!
Reply With Quote
Old 03-20-2017, 08:42 AM
bgagnon bgagnon is offline
VanDyke Technical Support
Join Date: Oct 2008
Posts: 3,378
Hello yardian,

vbs untils stopping do while,please help me,ths!
Please elaborate on the above statement. I do not see you using any "untils", if by that, you mean a "Do Until Loop"?

There is an "exit do" statement within the Do While, so that could explain it appearing to stop. Based on the output you are receiving, do you expect the "if side" to execute, or the "else side"?

VanDyke Software
Technical Support
(505) 332-5730
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 08:13 AM.