This is an old revision of the document!

Session.ExecuteCommand Method

Executes command on the remote server.

This feature will be available only with the next release.

Syntax

public CommandExecutionResult ExecuteCommand(string command)

Advertisement

Parameters

Name Description
string command Command to execute.

Return Value

CommandExecutionResult with command output.

Exceptions

Exception Condition
InvalidOperationException Session is not opened.
SessionLocalException Error communicating with winscp.com.
See the exception documentation for details.
SessionRemoteException Session has failed.
Command has failed.
See the exception documentation for details.
TimeoutException Timeout waiting for winscp.com to respond.

Remarks

With SFTP and SCP protocols, executes arbitrary remote shell command. With FTP protocol, executes a protocol command.

Advertisement

With SFTP protocol, that does not allow execution of arbitrary remote command, separate shell session will be automatically opened.

The command must not require user input.

Last modified: by martin