Topic Path: Symbol Reference > Classes > TIdRSH Class > TIdRSH Methods > Execute Method
TIdRSH.Execute Method

This method executes a command (ACommand) on the RSH Deamon.

function Execute(
    ACommand: String
): String; override;
The command to execute on the remote system. 

String - The results from the command that was executed or no value if an error occurred.

Execute is an overridden String function that implements the method used to authenticate the RSH shell session, and execute the command specified in ACommand. 

Execute passes the values in ClientUserName and HostUserName to the RSH Daemon to perform authentication. 

Execute is intended for non-interactive processes where the no input is expected from the user. 

The return values for the method is the values received from execution of ACommand on the specified Host. If an error occurs, TIdRemoteCMD.ErrorReply is set to True and ErrorMessage is updated with the value returned from the RSH Daemon. 

The inherited UseStdError property effects how error messages are sent from the RSH Daemon.

Copyright 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.