Sending Commands to a Server (RemoteCommand)

Use the RemoteCommand method to send the server any supported command. This function acts like the raw input command found in CuteFTP.

Syntax

Object.RemoteCommand(BSTR bstrCmd)

Example

Set MySite = CreateObject("CuteFTPPro.TEConnection")

'Initialize all necessary fields for MySite : host name, user, password, etc.

MySite.RemoteCommand "PWD" 'sends a print working directory command

 

If you include the word "LIST", or "RETR", or "STOR" in bstrCmd then the Transfer Engine will open the data connection, perform the operation (to the buffer) and then discard it. You should use the GetList, Download or Upload methods to accomplish these tasks.

You can combine strings to perform custom commands. For example, if you wanted to do use CHMOD on a file, you could do as shown in the example below:

Example

Set MySite = CreateObject("CuteFTPPro.TEConnection")

'Initialize all necessary fields for MySite : host name, user, password, etc.

strMODE = "777" 'full permissions

strFile = InputBox("Type in the file name below ", "CHMOD Dialog", "cftppro10.log") 'an input dialog with some default content

strvar = "SITE CHMOD " & strMODE & " " & strFile 'concatenate the values

MySite.RemoteCommand strvar 'send the command