Discuss this help topic in SecureBlackbox Forum

TElSimpleSSHClient.ExecuteCommand

TElSimpleSSHClient     See also     


Filter: C#  VB.NET  Pascal  C++  PHP  Java  


This method sends command to the server.

Declaration

[C#]
    byte[] ExecuteCommand(string Cmd);
    byte[] ExecuteCommand(string Cmd, bool RedirectStdErr);
    byte[] ExecuteCommand(string Cmd, ref byte[] StdErrData);
    byte[] ExecuteCommand(string Cmd, bool RedirectStdErr, bool KeepConnectionOpen);
    byte[] ExecuteCommand(string Cmd, ref byte[] StdErrData, bool KeepConnectionOpen);

[VB.NET]
    Function ExecuteCommand(ByVal Cmd As String) As Byte()
    Function ExecuteCommand(ByVal Cmd As String, ByVal RedirectStdErr As Boolean) As Byte()
    Function ExecuteCommand(ByVal Cmd As String, ByRef StdErrData As Byte()) As Byte()
    Function ExecuteCommand(ByVal Cmd As String, ByVal RedirectStdErr As Boolean, ByVal KeepConnectionOpen As Boolean) As Byte()
    Function ExecuteCommand(ByVal Cmd As String, ByRef StdErrData As Byte(), ByVal KeepConnectionOpen As Boolean) As Byte()

[Pascal]
    function ExecuteCommand(const Cmd: string): ByteArray;
    function ExecuteCommand(const Cmd: string; RedirectStdErr: boolean): ByteArray;
    function ExecuteCommand(const Cmd: string; var StdErrData As Byte()): ByteArray;

[C++]
    void ExecuteCommand(const std::string &Cmd, std::vector<uint8_t> &OutResult);
    void ExecuteCommand(const std::string &Cmd, bool RedirectStdErr, std::vector<uint8_t> &OutResult);
    void ExecuteCommand(const std::string &Cmd, std::vector<uint8_t> &StdErrData, std::vector<uint8_t> &OutResult);
    void ExecuteCommand(const std::string &Cmd, bool RedirectStdErr, bool KeepConnectionOpen, std::vector<uint8_t> &OutResult);
    void ExecuteCommand(const std::string &Cmd, std::vector<uint8_t> &StdErrData, bool KeepConnectionOpen, std::vector<uint8_t> &OutResult);

[PHP]
    string ExecuteCommand(string $Cmd)
    string ExecuteCommand(string $Cmd, bool $RedirectStdErr)
    string ExecuteCommand(string $Cmd, array of byte|string &$StdErrData)
    string ExecuteCommand(string $Cmd, bool $RedirectStdErr, bool $KeepConnectionOpen)
    string ExecuteCommand(string $Cmd, array of byte|string &$StdErrData, bool $KeepConnectionOpen)

[Java]
    byte[] executeCommand(String Cmd, byte[][] StdErrData, boolean KeepConnectionOpen);
    byte[] executeCommand(String Cmd, byte[][] StdErrData);
    byte[] executeCommand(String Cmd, boolean RedirectStdErr);
    byte[] executeCommand(String Cmd);
    byte[] executeCommand(String Cmd, boolean RedirectStdErr, boolean KeepConnectionOpen);

Parameters

  • Cmd - command to be executed
  • RedirectStdErr - specifies, whether to redirect STDERR channel to output data
  • StdErrData - buffer for data from STDERR channel
  • KeepConnectionOpen - ...

Return value

    Returns server response.

Description

    This is a high-level method that connects to server, executes command and gets the entire response. Use this method to execute a simple command which does not require client-server interaction.
    Please note, that you should not call Open/SendData/ReceiveData/Close methods of the component if ExecuteCommand is used, as the method performs all the necessary calls internally.

See also:     Open     SendData     ReceiveData     Close    

Discuss this help topic in SecureBlackbox Forum