Welcome to the VanDyke Software Forums

Join the discussion today!

Go Back   VanDyke Software Forums > Scripting


Closed Thread
Thread Tools Rate Thread Display Modes
Old 08-02-2012, 05:49 PM
bgagnon bgagnon is offline
VanDyke Technical Support
Join Date: Oct 2008
Posts: 4,636
Post 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.

Attached Files
File Type: txt SFTPTabAutomation.vbs.txt (3.5 KB, 2314 views)
File Type: txt SFTPTabAutomation.py.txt (4.3 KB, 2099 views)
File Type: txt AutomateConnectSFTPForOpenTabs.py.txt (4.2 KB, 720 views)
File Type: txt SFTP_Tab_ConnectionLogonScript(close-shell-tab).py.txt (1.8 KB, 592 views)

Last edited by jdev; 04-28-2021 at 10:14 AM. Reason: Add logon script example for a copy of an existing SSH2 session
Closed Thread

example script

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 02:23 PM.