VanDyke Software

Scripting Examples

Index

SFTP Tab Automation

These example scripts demonstrate the automation of various aspects of SecureCRT's SFTP tab functionality.

Watch the video: The SFTP Tab in SecureCRT

Original Script Example:
SFTPTabAutomation.vbs.txt
SFTPTabAutomation.py.txt
The scripts above demonstrate opening an SFTP tab and programmatically driving a file download. Prior to running a copy of this script, the currently active tab must already be connected with the SSH2 protocol to a remote server that is capable of providing SFTP functionality; otherwise an error will occur and script execution will be halted.

Open SFTP Tabs for All Connected Sessions:
AutomateConnectSFTPForOpenTabs.py.txt
This example script will open SFTP connections for all connected tabs in the same SecureCRT window, by default closing existing shell tabs. No file transfers are automated in this example; its purpose is to show how to open SFTP tabs in place of shell connections (and it also shows how to drive the Command Window in Send to All mode, in order to send initial lpwd and pwd commands to each new SFTP tab).

Logon Script Example:
SFTP_Tab_ConnectionLogonScript(close-shell-tab).py.txt
This example script is designed to be used as a logon script for a copy of an existing SSH2 session. Suggested usage is to name the copy with a trailing "-SFTP" tag, and configure this copy with the Logon script in the Session Options / Logon Actions category set to this script file. The script will (a) connect, (b) create an SFTP tab using the established SSH2 connection, and then (c) close the original SSH2 shell tab. If the SSH2 server does not support SFTP connections, this script will fail.

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.