function ExecuteCommand(const Command: string): string;

 

Description

Executes Command on the server. ExecuteCommand establishes the logical connection to the SSH server and sends a command execution inquiry.

If NonBlocking mode is not enabled, the method waits until the command is executed, and then returns a result. After the result is obtained, connection to the server is closed. So, this method can execute only one command within a connection.

In NonBlocking mode the method immediately returns an empty string, and does not wait until the command is executed. The command execution result can be obtained with the ReadString or ReadBuffer method.

The result of the ExecuteCommand method is tightly related to the SSH server that executes the command.

An alternative way to execute commands remotely is calling the WriteString and WriteBuffer methods.

 

See Also

NonBlocking

ReadString

WriteString

SecureBridge Components, Copyright © 2007-2024 Devart. All Rights Reserved. Provide Feedback Visit Forum Request Support