Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 12-18-2017, 12:34 PM
mschaafs mschaafs is offline
Registered User
 
Join Date: Oct 2017
Posts: 27
Input Locking While Running?

Good day! I am wondering if there is a way to keep SecureCRT from accepting keystrokes or right clicks while it is running a script. We have sensitive processes running and if someone accidentally types something or right clicks (pasting the clipboard contents)... it can at best crash the script, at worst inadvertently cause unintended commands to execute. Thank you...
Reply With Quote
  #2  
Old 12-18-2017, 01:56 PM
ekoranyi ekoranyi is offline
VanDyke Technical Support
 
Join Date: Jan 2017
Posts: 654
Hi mschaafs,

There is!

Changes in SecureCRT 8.3 (Beta 1) -- September 21, 2017
-------------------------------------------------------
- Added the ability to script session locking from the Session object.

Lock
Description
Locks the current session (or all sessions).
Remarks
All the parameters are optional. The default for prompt is false. If prompt is true, the Lock Session dialog will be displayed. The default for password is the empty string ("") and the default for lockallsessions is false.
Syntax
object.Lock([,prompt [,password, [,lockallsessions]]])
As an example you could use:

Code:
crt.Session.Lock
<your code>
crt.Session.Unlock
This would silently lock the session preventing input, unlocking when you're ready to release control.
Does this give you the functionality you're looking for?
__________________
Thanks,
--Eric

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

Last edited by ekoranyi; 12-18-2017 at 03:46 PM.
Reply With Quote
  #3  
Old 12-20-2017, 11:19 AM
mschaafs mschaafs is offline
Registered User
 
Join Date: Oct 2017
Posts: 27
Talking Wonderful!

Hello! Thank you... that is fantastic. Do dialog boxes work while the Lock is in place? Such as crt.Dialog.MessageBox and crt.Dialog.Prompt?
Reply With Quote
  #4  
Old 12-20-2017, 11:32 AM
ekoranyi ekoranyi is offline
VanDyke Technical Support
 
Join Date: Jan 2017
Posts: 654
Hi mschaafs,

They sure do, I've included some example code to demonstrate this.

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

crt.Session.Lock

strInput = crt.Dialog.Prompt("Please enter some input", "Test Prompt", "")
crt.Dialog.MessageBox strInput

crt.Session.Unlock
__________________
Thanks,
--Eric

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #5  
Old 12-20-2017, 12:30 PM
mschaafs mschaafs is offline
Registered User
 
Join Date: Oct 2017
Posts: 27
Unhappy Trouble...

I am getting a failure on this... in Javascript on version 8.3.1:

crt.Session.lock();
crt.Session.unlock();

"Microsoft JScript runtime error

Error: Object doesn't support this property or method"

Please help? Thank you.
Reply With Quote
  #6  
Old 12-20-2017, 12:49 PM
ekoranyi ekoranyi is offline
VanDyke Technical Support
 
Join Date: Jan 2017
Posts: 654
Hi mschaafs,

This feature became available in SecureCRT 8.3 (Beta 1). What version of SecureCRT are you running (Help > About SecureCRT)?
__________________
Thanks,
--Eric

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

Tags
error , input locking , javascript , scripting , stop script


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 07:14 PM.