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 11-06-2018, 08:03 AM
Celltech Celltech is offline
Registered User
 
Join Date: Nov 2018
Posts: 3
Combination proxy/login via script only

Hi, new CRT user trying to see if this application will work for our company.

I have a requirement to run a script *before* anything else. The script will launch a program that generates a secure token to be used as the password for a proxy server.

Once that token is generated I want the script to pull the Hostname and Username from the session manager and call the proxy with the 3 pieces of information.

So far is seems that CRT is wanting to connect to the session first and then attempt to run my script. How can I get CRT to just run the script and do nothing else?

Thanks!
Reply With Quote
  #2  
Old 11-06-2018, 09:03 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 3,569
Hi Celltech,

It sounds like you were configuring a Logon script which will connect first. However, you can independently run a script from Script menu -> Run or using the command-line syntax:
Code:
SecureCRT /Script "path_to_your_script"
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #3  
Old 11-06-2018, 10:11 AM
Celltech Celltech is offline
Registered User
 
Join Date: Nov 2018
Posts: 3
Thanks, but I don't want to use Script -> Run. I want to be able to double click my session and have it run the script, then the script will pull the hostname/username from the session data and use it to complete the sequence.

Is that possible?
Reply With Quote
  #4  
Old 11-06-2018, 10:21 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 3,569
Hi Celltech,

You can still connect your session from within the script:

VB example:
Code:
Set objTab = crt.Session.ConnectInTab("/S YourSessionNameHere")
Then, to get specific properties from the session, such as hostname/username, you would use the GetOption() method available to the SessionConfiguration Object. See the SecureCRT Help Topic Scripting / Script Objects Reference for more specific info.
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #5  
Old 11-06-2018, 10:37 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 3,569
Hi Celltech,

I have added this thread to a feature request in our product enhancement database for an option to allow the user to run an alternate script, either before or after connecting to a Proxy Server (pre-connect script). Should a future release of SecureCRT include this feature, notification will be posted here.

If you prefer direct email notification, send an email to support@vandyke.com and include "Feature Request - Forum Thread #13311" in the subject line or use this form from the support page of our website.
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #6  
Old 11-06-2018, 01:05 PM
Celltech Celltech is offline
Registered User
 
Join Date: Nov 2018
Posts: 3
Thanks Brenda, I appreciate it.

Is there a way to get CRT to sleep/pause while the "Local Shell Command / Pre-Connect" is running in the background?
Reply With Quote
  #7  
Old 11-06-2018, 02:05 PM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 3,569
Hi Celltech,

No, the Pre-connect functionality currently available is intended just to run a command.
Quote:
Pre-connect
Enter a command to be executed in a separate process on the local machine prior to establishing the connection for the session.
It won't work with your script idea, thus the feature request.
__________________
Thanks,
--Brenda

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


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 02:32 AM.