WS_FTP - Can I use WS_FTP from the command line?

Product: Version: Platform:
WS_FTP All All

Question/Problem: How can I transfer files from a command line?

Answer/Solution: All current versions of WS_FTP can transfer files from a command line. Wild cards are supported so it is possible to transfer multiple files (from one directory) by executing a single command.

WS_FTP Pro 8.0 User's Guide - Using the Command Line

Command Summary (WS_FTP Pro Command Line)

Here is a list of all arguments you can use in the command line. Note that the -i argument must precede the -p argument when both are used, and that both of these arguments must precede any other arguments.

Arguments (alphabetical) When to use Important restrictions
-ascii
Use -ascii when transferring text files.
-binary
Use -binary when transferring non-text files such as executable programs, word processing documents, and so on.
-c account
Use -c to work with servers that require an account for the user to log in, or to access partitions. account is the name of your account on the FTP server.
-d path_and_filename
Use -d to indicate the destination path and desired file name of the file you want to upload or download. The path on the FTP site must be either a fully qualified path such as:-d sitename:/root/path/filenameor relative, such as:
-d sitename:filename
-i inifile (The -i parameter is no longer valid in version 7.0x. See below.)
Always use -i to indicate which site folder the site configuration is stored in. For example, you would use -i games.ini if the FTP site is stored in your Games folder. (the only time you don't need this parameter is if the site is stored in your "Sites" folder. The -i argument must precede all other arguments.
-lower
Use -lower to have WS_FTP Pro convert file names to lower case letters when
you transfer from your local system to a remote FTP system. If you use the -lower argument, it must be at the very end of the command line.
-m text_file
Use -m to do transfers that involve multiple source locations, multiple destinations, or multiple commands. text_file is the name of the file that contains the commands.
For example, write a command line:

"C:\Program Files\WS_FTP\ftp95pro.exe" -m file.txt
where file.txt contains:

-p profile_name -s profile_name:/dir1/test.gif -d local:c:\test\
-p profile_name -s profile_name:/dir1/web/*.HTML -d local:c:\webroot\

A log file named xferlog.txt will be written, either to the source or to the
destination directory.

-p sitename
Use -p to connect to a configured site, where sitename is the name of the configured site. The configured site must be in the default .ini file or in the .ini file specified with the -i argument. The -p argument must precede all arguments except -i.
-quiet
Use -quiet to prevent WS_FTP Pro from displaying message boxes.
-s path_and_filename
Use -s to indicate the source path and filename of the file you want to upload or download. The path on the FTP site must be either a fully qualified path such as:-d sitename:/root/path/filename or relative, such as:-d sitename:filename

WS_FTP has its limitations when used from a command line. For example it will not transfer directory structures and will not create directories if they do not exist. It cannot delete files or directories.

Extras (WS_FTP Pro Command Line)

There are a few extra arguments and uses of the command line that some users
have found helpful. These are listed below.

To have WS_FTP Pro display a dialog box that prompts you for the command
line, type: ftp95pro -ask

To launch the WS_FTP Pro Classic interface and default to the site configuration for the Damion site: ftp95pro -i games.ini -p Damion

To prevent WS_FTP Pro from displaying error messages, use the -quiet
argument. This is useful if you want to do automated transfers when no-one
is around to respond to a message. An example:

ftp95pro -i games.ini -p Damion -s local:c:\Sports\Tag.doc -d
Damion:/pub/Drop/Tag.doc -quiet

The path on the FTP site (whether it is the source or the destination) must be correct. It should be either a fully qualified path such as:

-d sitename:/root/path/filename
or relative, such as:
-d sitename:filename

There have been some changes to the Command Line Utility in version 7.
1. The name has changed from ftp95pro to wsftppro.
2. The -i command is no longer a supported command in 7.0 and was replaced
with the !profile name.
The following illustrates the correct command line syntax, broken down by argument type:

(command name: wsftppro) (source) (destination)

Example:

Old way (NO LONGER SUPPORTED):
ftp95pro -i games.ini -p Damion -s local:c:\Sports\Tag.doc -d damion:/pub/Drop/Tag.doc -quiet

New Way:
wsftppro -s local:c:\Sports\Tag.doc -d original!Damion:/pub/Drop/Tag.doc -quiet 

If you use a configured site from the command line, WS_FTP Pro uses the User ID, Password, and Account Name you saved in the site configuration. To do this, place the site folder and site profile in front of the remote directory (this can be either the source or the destination). The site folder and site profile has to be separated by the ! symbol. In the example above, we use the Damion site profile stored in the original folder. (Sites in the MySites folder use the original.ini file.)

WS_FTP has its limitations when used from a command line. For example it will not transfer directory structures and will not create directories if they do not exist. It cannot delete files or directories.

Document #: Revision Date:
WS-19980116-DM01 06/14/04

Return To KnowledgeBase Search Page