VanDyke Software Forums

Go Back   VanDyke Software Forums > Scripting
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 07-27-2010, 11:53 AM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 1,015
Hi Stefan,

After some testing, I have found a way to accomplish your goal. First, you must configure SecureCRT to not save settings by disabling Options / Auto Save Options. After disabling this option, you must use Options / Save Settings Now to save the change you have made.

With this SecureCRT configuration change, you should be able to run the following script to load a session, change the username and connect with the new username.
Code:
' Load session to be used for connection Set objConfig = crt.OpenSessionConfiguration("<session_name>") MsgBox objConfig.GetOption("Username") ' Prompt user for new username to use strNewUN = crt.Dialog.Prompt("Please enter the new username.") ' Set the new username entered by the user objConfig.SetOption "Username", strNewUN MsgBox objConfig.GetOption("Username") ' Connect to the remote device using the new username objConfig.ConnectInTab
Another option would be to use an ad hoc session. For example:
Code:
crt.Session.Connect "/ssh2 hostname"
Does this help to answer your question?
__________________
--Todd

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


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

vB 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 11:03 PM.


© copyright 1995-2010 VanDyke Software, Inc.