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 03-03-2005, 07:33 AM
Vlad Ershov Vlad Ershov is offline
Registered User
 
Join Date: Mar 2005
Location: Russia, Nizhny Novgorod
Posts: 9
logon script with parms

I've got a mass of the same devices with diffrent login names and pwd.
It will be really great to use the same logon script for all devices passing login and password to it?

Is it possible to realize?

Thanks in advance.
Reply With Quote
  #2  
Old 03-04-2005, 05:46 PM
jdev's Avatar
jdev jdev is offline
VanDyke Technical Support
 
Join Date: Nov 2003
Location: Albuquerque, NM
Posts: 998
The ability to pass arguments to a logon script is something that has been requested before, and we are considering adding this functionality to a future release of SecureCRT.

If you will send me a private message with your contact information, we'll be happy to let you know when this functionality becomes available. In the meantime, there is a workaround that might get you closer to your goal.

SecureCRT can take the path to a script file as an argument with the /SCRIPT command line option. Arguments can be passed to the specified script using one or more of the /ARG command line option.

Here's an example of launching SecureCRT with a logon script, and passing in three arguments (hostname, username, and password:
SecureCRT /SCRIPT c:\temp\telnetLoginScript.vbs /ARG myusername /ARG "my password has spaces in it" /ARG 192.168.0.1
As soon as a connection is established with the remote host, the specified script will be run, and the arguments supplied on the command line via the /ARG option(s) will be available through the crt.Arguments object, similar to how the WScript.Arguments object works in VBScript. Here's an example snippet of code that takes advantage of the arguments that are passed in using the /ARG example above:
Code:
# $language = "VBScript"
# $interface = "1.0"

Option Explicit

' Connect to a telnet server and automate the initial login sequence.
' Note that synchronous mode is enabled to prevent server output from
' potentially being missed.
' 
' The first argument to this script is expected to be the
' username.
' 
' The second argument to this script is expected to be the
' password.
'
' The third argument to this script is expected to be the
' hostname or IP address of the target machine

Sub Main
    Dim szUsername, szPassword, szHost
	
    if crt.Arguments.Count < 3 then
        MsgBox "Usage: " & vblf & vbtab & _
            "SecureCRT.exe /Script telnetLoginScript.vbs" & _
            "   /ARG username   /ARG password   /ARG HostIP"
        exit sub
    end if
	
    ' Retrieve the arguments
    szUsername = crt.arguments(0)
    szPassword = crt.arguments(1)
    szHost     = crt.arguments(2)
    
    crt.Screen.Synchronous = True
    
    crt.Session.Connect "/TELNET " & szHost
    
    crt.Screen.WaitForString "ogin:"
    crt.Screen.Send szUsername & vbCr
    
    crt.Screen.WaitForString "assword:"
    crt.Screen.Send szPassword & vbCr
	
End Sub
Although it isn't currently possible to save this information as part of a session and pass in arguments to a common script, you can have a common logon script as in the above example and create shortcuts to SecureCRT that call the script with different arguments.
__________________
Jake Devenport
VanDyke Software
Technical Support
YouTube Channel: https://www.youtube.com/vandykesoftware
Email: support@vandyke.com
Web: https://www.vandyke.com/support
Reply With Quote
  #3  
Old 03-05-2005, 02:33 AM
Vlad Ershov Vlad Ershov is offline
Registered User
 
Join Date: Mar 2005
Location: Russia, Nizhny Novgorod
Posts: 9
Thanks for your response Jake,
Your info is pretty usefull for my goals in spite of many windows opened using this approach.

Regards,
Vlad.
Reply With Quote
  #4  
Old 10-17-2007, 08:50 AM
kskyle kskyle is offline
Registered User
 
Join Date: Sep 2006
Posts: 1
logon script with parms

Has the ability to pass arguments to a logon script been added to SecureCRT?
Reply With Quote
  #5  
Old 10-17-2007, 02:47 PM
kbarnette kbarnette is offline
VanDyke Technical Support
 
Join Date: Aug 2007
Posts: 587
Hi kskyle,

This capability has not yet been implemented in SecureCRT. If would like to be contacted via email in the event that this functionality becomes available please send us a request.
Reply With Quote
  #6  
Old 05-10-2012, 10:23 PM
zalyan zalyan is offline
Registered User
 
Join Date: May 2012
Posts: 2
Hello,

has ability to pass arguments to logon script been added?

Thanks in advance.
Reply With Quote
  #7  
Old 05-11-2012, 07:19 AM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,306
Hi zalyan,

Thanks for the question. This feature has not yet been added to SecureCRT.

There may be a way to work around the lack of this feature. Can you tell me more about your goal?
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
  #8  
Old 07-22-2013, 02:24 PM
Maureen's Avatar
Maureen Maureen is offline
VanDyke Product Director
 
Join Date: Feb 2004
Location: Albuquerque, NM
Posts: 1,584
The ability to pass arguments to logon scripts has been added to a pre-beta version of SecureCRT. If you would like to try it, please send email to me at Maureen.Jett@vandyke.com.

Maureen
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 08:39 AM.