Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Notices

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 02-29-2012, 07:47 AM
George_Fee's Avatar
George_Fee George_Fee is offline
Registered User
 
Join Date: Feb 2012
Location: Plano, TX
Posts: 18
Adding "delay" to a script.

I would like to be able to launch a script to issue a specific command every five minutes. I read thru the "Scripting Essentials: A Guide to Using VBScript in SecureCRT" but did not see anything like a "wait x minutes" or "pause x minutes" type command.

I really hate the CLI timeout we have to set and there are times when I'd like to check something every 5 or 10 minutes in connection with a problem I'm working. If I turn to another task for a few moments, I get timed out and have to logon again. It is painfully annoying.

If I could launch a script I would get my displays and stay logged in even if I'd been distracted for a few minutes by another task.
Reply With Quote
  #2  
Old 02-29-2012, 10:56 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,636
Hello George,

A couple ideas to get around the disconnects in general:
  • One thing you might want to do is configure an anti-idle option in the Terminal category of SecureCRT's Session Options.
  • Also, you may want to enable Auto reconnect in the Terminal category of Global Options.
As far as the script, are you using SecureCRT for Windows?

What scripting language did you intend to use?

The easiest way to get started on a script is to use the built-in Script Recorder. The current release (SecureCRT 6.7.4) would allow the script to be saved in VBScript or Python.

The 5 minute delay can be accomplished with a Sleep command.

Code:
crt.Sleep (1000 * 60) * 5
If you need further assistance with the script, please provide additional details as far as what you are trying to accomplish, what commands need to be run, etc.
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #3  
Old 03-04-2012, 03:12 AM
George_Fee's Avatar
George_Fee George_Fee is offline
Registered User
 
Join Date: Feb 2012
Location: Plano, TX
Posts: 18
My Code is Feeling "Sleepy"...

Thanks for the tip! I had been browsing the PDF of the Scripting Essentials book and was looking for words like "delay" or "pause" it never occurred to me that the command would be "sleep" though I guess it makes sense.

I was able to do exactly what I wanted! Thanks!
Reply With Quote
  #4  
Old 03-05-2012, 08:17 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,636
Hi George,

Thanks for the update! I am glad to hear the issue is resolved.
__________________
Thanks,
--Brenda

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

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 10:11 AM.