Example: SFTP Tab Automation
These example scripts demonstrate automation of various aspects of SecureCRT's SFTP tab functionality.
Original Script Example:
These scripts above demonstrate opening an SFTP tab & 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:
This example 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; it's 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 as well, in order to send initial lpwd and pwd commands to each new SFTP tab).
Logon Script Example:
This example 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.
Last edited by jdev; 04-28-2021 at 09:14 AM. Reason: Add logon script example for a copy of an existing SSH2 session
|Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)|
|Display Modes||Rate This Thread|