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-07-2012, 06:35 AM
emailsbecker emailsbecker is offline
Registered User
 
Join Date: Apr 2011
Posts: 74
How do I open a new tab with certain session options?

I found and modified some code and have this:

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


sub Main

Dim sTabName
susersPass

sUser 
"user"
sPass "pass"

'******** SSH2 TAB login ********
Set sTabName = crt.Session.ConnectInTab ("/SSH2 /ACCEPTHOSTKEYS /L " & sUser & " /PASSWORD " & sPass & " 

""71.44.32.133""")
sTabName.Caption = "Session 1"

End Sub 
I have certain preferences saved in my Session Options (for example I prefer certain colors rather than monochrome black & white) and I have mapped keys. But when the script above connects it uses Global Options ... the Global Options retains my mapped keys but will not retain my color choices. What can I do to either make Global Options save my color choices or force the script above to use the Session Options over the Global Options?

Thanks!
Reply With Quote
  #2  
Old 03-07-2012, 08:44 AM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,306
Hi emailsbecker,

If you want to use settings in a pre-defined session, then you would want to use the /S option to connect using the session.

If you want to use an ad hoc connection (as illustrated in your script), you would need to define the same settings that you have for your session in the Default Session. You can modify the Default Session settings in the General / Default Session category of the Global Options dialog.
  1. Make any desired changes to the Default Session (for example: changing the color scheme or emulation).
  2. Press the OK button
  3. You should be presented with the following warning:

    ---------------------------
    SecureCRT
    ---------------------------
    Do you want to apply the changes that you made to the Default Session to ALL of your sessions?



    WARNING: There is no UNDO for this change.


    ---------------------------
    Yes No
    ---------------------------
  4. If you want to make the changes to all existing sessions, press the Yes button.
In this case, it seems like you don't need to make the change to all sessions, so you may want to chose No.

Does this help you accomplish your goal?
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
  #3  
Old 03-07-2012, 10:22 PM
emailsbecker emailsbecker is offline
Registered User
 
Join Date: Apr 2011
Posts: 74
Hi rtb,

Actually your post guided me to what I needed. I was changing the appearance in:

Global Options > Terminal > Appearance > Advanced

But what I needed was:

General > Default Session > Edit Default Settings > Terminal > Appearance

... When I changed the option under the first path I was clicking the OK button but it never saved the info. When I used the path you referred to it did save my change. Thanks!
Reply With Quote
  #4  
Old 03-08-2012, 08:05 AM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,306
Hi emailsbecker,

I am glad to help. I suspect that the tip about color in SecureCRT that we recently posted to our website may be of use to anyone reading this thread. The tip explains how ANSI color and Color Schemes work in SecureCRT and can be found at the following location:
http://www.vandyke.com/support/tips/colorconfig.html
__________________
--Todd

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 04:55 PM.