edtFTPnet/PRO - Secure FTP component for .NET | Free Trial | Pricing

How to use the FTP Shell

FTPShell is a powerful command shell that enables users to manually execute a series of FTP commands in a similar way to Windows' ftp.exe. It supports FTP, SFTP and FTPS.

FTPShell is very useful as a quick way of connecting to servers, and an excellent way to develop FTPScript (as commands can be saved to file). See the command reference for more details on script/shell commands.

The command shell is started by running edtftp.exe (available from the Programs menu as the FTP Shell). If no options are supplied, the standard prompt appears:

ftp>

At this point, the shell is not connected as a host has not been specified. Commands can be now be entered. Typically, the next commands might be:

set remotehost=edtmobile
set user=javaftp
set password=javaftp
set protocol=ftp

The open command can now be called to open a connection to the specified server:

ftp>open

Once a connection has been established, the usual FTP commands (and many additional commands) can be executed as detailed in the command reference. Type 'help' to get an overview.

A sample session is shown below:

ftp> set user=javaftp
Set user = javaftp
ftp> set pwd=javaftp
Set password
ftp> set host=edtlinux1
Set host = edtlinux1
ftp> set protocol=sftp
Set protocol = SFTP
sftp> open
Opened connection to edtlinux1
sftp> dir<
drwxr-xr-x   1 1001     100          4096 Jul 24 05:45.
drwxr-xr-x   1 0        0            4096 Oct 14 2007 ..
lrwxrwxrwx   1 1001     100            26 Apr 21 2007 Examples
drwxr-xr-x   1 1001     100          4096 Sep 03 09:57 remote
sftp> cd remote/test
cd successful
sftp> set localdir=d:\downloads
Set local directory = d:\downloads
sftp> get test.jar
sftp> quit
Closed connection
sftp> quit

Once all the operations required have been completed, the connection can be closed by the close, quit or bye commands. The user will still be within the shell, and the open command can be used to re-open a connection. The set command can be used to reset parameters so that a new host can be logged into, or the close, quit or bye commands can be used again to exit the shell session.

Command-line options

For the advanced user there are a variety of command-line options that are described below:

edtftp [user@]host[:port] [-c configfile] [-f scriptfile] [-d] [-n] [-h] [-p password] [-o protocol] [-l licenseowner]
	[-k licensekey] [-r|-i] [-v]
-c configfile       : configuration script to run before connecting. Any commands may be used, including open
-f scriptfile       : run the scriptfile after the configfile and exit
-d                   : run with debug switched on
-n                  : do not connect to the server (default is to connect if credentials and host supplied)
-h                  : display the help
-p password         : set the user password
-l licenseowner     : specify the license owner
-k licensekey       : specify the license key 
-r                  : update the registry with the license owner/key
-i                  : write a configuration file with the license owner/key
-v                  : print version details

For example, the shell could be started with:

edtftp.exe javaftp@edtlinux1:21 -p javaftp

As there is sufficient information (host, username, password) a connection is immediately opened to the specified host (called edtlinux1 in this instance) on port 21, and an attempt to establish a standard FTP session will be made. If connection and login is successful, the user will be informed of this.

These options could be set up for shortcuts to edtftp.exe so that selecting different icons could establish sessions with different hosts or different protocols on hosts.

Licensing

If your trial license has expired, you can supply new license details on the command line while running the shell:

edtftp.exe -l trialuser -k xxx-xxx-xxx-xxx

You can also update the registry with new license details. This need only be done once for a production license:

edtftp.exe -l trialuser -k xxx-xxx-xxx-xxx -r

You can also write the license details to a configuration file for edtftp.exe (in Vista you may need administrative permissions to do so depending on where the file is written to):

edtftp.exe -l trialuser -k xxx-xxx-xxx-xxx -i