VanDyke Software

Tips

Index

Tab Scripting With SecureCRT® 5.2 and Later

Note: This tip is for use with SecureCRT for Windows®.

SecureCRT 5.2 and later supports scripting functions to control multiple tabbed sessions from a script. Tabs functions allow scripts to connect Secure Shell command and SFTP tabs, clone tabs, activate tabs, and close tabs. Examples of common application are opening multiple tabbed sessions in a specific order, and prompting for a command and sending it to multiple tabbed sessions.

Below are sample scripts written in VBScript demonstrating each of the tab functions.

ActivateTab.vbs Opens a specified session as a tab and brings it to the foreground
CloneTab.vbs Takes a session window and creates a duplicate (clone) window
CloseTab.vbs Opens a specified session as a tab and then disconnects the session
ConnectSFTPTab.vbs Connects to a defined session and then opens an SFTP tab window for that session
DisconnectTab.vbs Opens a session in a tab and then disconnects it
SendToAll.vbs Takes a command and sends it to all open tabs

The above scripts use the following tab-specific script functions:

crt.Session.ConnectInTab()
crt.GetTabCount()
crt.GetTab()
objTab.Activate()
objTab.Clone()
objTab.Close()
objTab.ConnectSftp()
objTab.Index()
objTab.Caption()
objTab.Session.Disconnect()
objTab.Session.Connected()
objTab.Screen.Send()

You can find more information about the Tab object in the SecureCRT Help files under Scripting / Script Objects Reference / Tab Object.

To learn more about scripting for SecureCRT, visit our SecureCRT Scripting Examples web page.

VanDyke Software uses cookies to give you the best online experience. Before continuing to use this site, please confirm that you agree to our use of cookies. Please see our Cookie Usage for details.