View Single Post
Old 05-30-2017, 11:57 AM
ekoranyi ekoranyi is offline
VanDyke Technical Support
Join Date: Jan 2017
Posts: 654
Hi respite,

I'm glad to hear you are exploring SecureCRT automation abilities.

I've included a brief example of one way this may be accomplished.

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

crt.screen.synchronous = true

Set g_fso = CreateObject("Scripting.FileSystemObject")
Set objFile = g_fso.OpenTextFile("C:\Users\<user>\Desktop\Log.txt", 8, True)

strText = crt.screen.ReadString(vbcrlf)

crt.screen.WaitForString("LAN1 IP: ")
strIP = crt.screen.ReadString(vbcrlf)

objFile.Write strIP & " has model AP-" & strText & vbcrlf
This assumes that every device will have a line that contains "AP-", there may be "hang" in the script if a device does not contain this line. If that is the case we may need to make some modifications.

Does this help?

VanDyke Software
Technical Support
(505) 332-5730
Reply With Quote