Example Scripts

SecureCRT


Example VBScripts can be found in the SecureCRT installation folder. If you would like to modify an example script, please modify a copy of the script file because if the original scripts are updated, the installer will overwrite the example scripts.

The following are descriptions of the example scripts:

    AddCommentToLogFile.vbs – This example script allows you to add a custom line of text to your SecureCRT log file.

    AutoResponder.vbs – Demonstrates how to set up a list of commands/text that get sent to the remote as soon as a corresponding "trigger" string/text is detected from the remote system.

    BasicReadStringExample.vbs – This example script captures the output of a command (ls -l) sent to a remote machine by using the Screen.ReadString() method. The captured text is then displayed in a message box window.

    ConnectToMultipleSessionsAndSendCommands.vbs – Reads in sessions from a file (one session per line) and connects to each one (one at a time) and sends a series of commands to the remote, then disconnects from the session and moves on to the next session.

    CopyOutputToClipboard.vbs – This script example is designed to run while connected to a Cisco Pix firewall or other router device.

    GoogleSelectedText.vbs – When this script is launched, the text selected within the terminal window is used as the search term for a web search using google.com.

    LogOutputOfSpecificCommand-UseReadString.vbs – Sends commands one by one as listed in the g_vCommands() array to the remote machine. The results of each command are captured into a variable, and then written to an individual log file (one log file for each command). Once all the commands have been run, Windows Explorer is launched, with the first command output file selected within the explorer window.

    SaveSelectedTextToFile.vbs – If non-whitespace text is selected within the terminal screen, the user will be prompted for a location and filename in which to store the selected text. The selected text will then be saved to the file specified by the user.

    SendCommandToAllTabs.vbs – This example script shows how to send the same command to all tabs that currently have an active connection.

    UseIEAsCustomDialog.vbs – This sample script shows how the Internet Explorer automation object can be used to create custom dialog that can be used within a SecureCRT script.

    UseIEAsListOutput.vbs – This example script shows how to create a custom dialog using the InternetExplorer.Application ActiveX object. This example also shows how data can be passed between the InternetExplorer object and SecureCRT.