View Single Post
  #2  
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.

Code:
# $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)

crt.screen.WaitForString("AP-")
strText = crt.screen.ReadString(vbcrlf)

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

objFile.Write strIP & " has model AP-" & strText & vbcrlf
objFile.Close
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?
__________________
Thanks,
--Eric

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote