View Single Post
  #6  
Old 07-16-2019, 11:59 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,636
Hi melarnell,

You dropped the Next from the For/Next and I'm not sure what you are doing with the Sleep(). (To clarify, SecureCRT's Sleep() method uses milliseconds, thus the 15 * 1000.)

Here's a snippet of code:
Code:
Set shell = CreateObject("WScript.Shell")
crt.Session.LogUsingSessionOptions

nInterval = 15 * 1000
nIterations = 240

For i = 0 to nIterations
    ' Run command
    crt.Screen.Send "tmsh show sys connection cs-server-addr x.x.x.x" & chr(13)
    ' Sleep 15 seconds
    crt.Sleep nInterval
Next

crt.Session.Log False

strLogFile = crt.Session.LogFileName

' Open the file for viewing
shell.Run chr(34) & strLogFile & chr(34)
__________________
Thanks,
--Brenda

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

Last edited by bgagnon; 07-16-2019 at 01:02 PM. Reason: clarification of sleep()
Reply With Quote