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-19-2019, 12:23 PM
never2spicy never2spicy is offline
Registered User
 
Join Date: Dec 2019
Posts: 16
Can get script that works on button to work as a login

So the following script works manually ran either as a button or manually in the menu. However setting it in the session and connecting nothing happens. How sure whats wrong, maybe i need to add a delay?

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

crt.Screen.Synchronous = True

' This automatically generated script may need to be
' edited in order to work correctly.

Sub Main
crt.Screen.Send "show run " & chr(124) & " no-more" & chr(13)
End Sub
Reply With Quote
  #2  
Old 12-19-2019, 12:55 PM
berdmann berdmann is offline
VanDyke Technical Support
 
Join Date: Aug 2017
Posts: 299
Hi never2spicy,

I am not sure what you meant by "setting it in the session". Are you trying to run the script right after connecting?

If so, did you configure the session to run the script as a logon script?

Do you have any Expect/Send logon actions defined?
__________________
Thanks,
--Brittney

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #3  
Old 12-19-2019, 03:04 PM
never2spicy never2spicy is offline
Registered User
 
Join Date: Dec 2019
Posts: 16
See "Configuring a login script in a saved session" on page 20 of "A guide to using VBscript in SecureCRT".
Reply With Quote
  #4  
Old 12-19-2019, 03:43 PM
berdmann berdmann is offline
VanDyke Technical Support
 
Join Date: Aug 2017
Posts: 299
Hi never2spicy,

Can you please send a screenshot of the Logon Actions window corresponding to the session that you are testing with, so that I can see exactly how you went about configuring your session?

Please send the screenshot to support@vandyke.com, with Attention Brittney, Forum Thread# 14016 in the subject line.
__________________
Thanks,
--Brittney

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

Last edited by berdmann; 12-19-2019 at 03:46 PM.
Reply With Quote
  #5  
Old 12-19-2019, 03:51 PM
never2spicy never2spicy is offline
Registered User
 
Join Date: Dec 2019
Posts: 16
Attached Images
File Type: jpg loginscreen.jpg (41.2 KB, 41 views)

Last edited by jdev; 12-21-2019 at 05:39 PM. Reason: Instead of uploading and referencing graphics from another third party site -- just upload them directly via the forums as "attachments".
Reply With Quote
  #6  
Old 12-19-2019, 05:24 PM
berdmann berdmann is offline
VanDyke Technical Support
 
Join Date: Aug 2017
Posts: 299
Hi never2spicy,

Per page 20 of the "Scripting Essentials: A Guide to Using VBScript", the steps to configure a logon script are:
  1. If the Connect dialog is not already displayed, open the Connect dialog by choosing File > Connect from SecureCRT's main menu.
  2. Right-click on the session you would like to target and choose Properties from the context menu.
  3. When the Session Options window appears, select the Connection > Logon Actions category.
  4. Enable the Logon script option, specify the path to the script file you would like to run during the connection process, and press the OK button.
Per these instructions, the only option that you should have enabled is "Logon Script", yet you have enabled the "Automate logon" and "Send initial carriage return" options, as well.

When you enabled the "Automate Logon" option you enabled the "Expect"/"Send" logon actions. So the reason the script is not running is because SecureCRT is waiting for "ogin:" to appear in the terminal window before proceeding.

Please disable the "Automate logon" and "Send initial carriage return" options and then re-test.
__________________
Thanks,
--Brittney

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

Last edited by jdev; 01-02-2020 at 03:41 PM.
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 05:18 AM.