SecureBlackbox 16: I need to send a command before transferring a file. How do I do this?

Note: This article applies only to SecureBlackbox Legacy. For future development please consider using the latest version.

TElSimpleSFTPClient has an ExecuteCommand method that executes a command via a command tunnel.

Some servers (mainly mainframe ones) require a command to be sent in order to set up data upload parameters. These servers don't necessarily expect a shell command -- it's possible that what looks like a "command" is just the use of SFTP protocol operations; e.g., the "command" "ls /something" is not a real shell command but a request to the ListDirectory() method with "/something" as a name to list.

We appreciate your feedback.  If you have any questions, comments, or suggestions about this article please contact our support team at