DOS Command Line Support


DOS Command Line Support

BlueZone Secure FTP uses command line switches so that the application can be executed and controlled from a DOS Command Line Interface or a DOS batch file or even a Windows program or script.

SEE  the Command Line Switch Table for a complete listing.

Basic Examples

If you want to launch the application from a DOS batch file and include a configuration file named "config.zft" to start the session, you would use the /F Command Line Switch.

"C:\progra~1\SEAGULL\BlueZone\BZFTP.EXE" /Fconfig.zft

 

If you want to launch the application from a DOS batch file and set the "Initial PC Directory" to a folder called C:\MyFiles, you would use the /I Command Line Switch.

"C:\progra~1\SEAGULL\BlueZone\BZFTP.EXE" /Ic:\MyFiles

 

You can also combine Command Line Switches in one statement.  For example, here's how it would look if you wanted to combine the two examples above.

"C:\progra~1\SEAGULL\BlueZone\BZFTP.EXE" /Fconfig.zft /Ic:\MyFiles

 

Or, instead of including a configuration file in your DOS batch file, you could direct the batch file to use one of the existing FTP host connections that you have stored in your Connection List.  This list is zero based, so if you want to call the first connection in the list, you would use /Z0 as shown here:

"C:\progra~1\SEAGULL\BlueZone\BZFTP.EXE" /Z0

Other Examples

Initial Commands (/L command line switch) are used to configure the application to perform specific FTP commands upon connect.  For example, suppose you wish to configure the application to perform an upload of a file named "upload.txt" and then a download of a file named "download.txt" during your batch execution.  The command line switch would be:

BZFTP.EXE /L"STOR upload.txt" /L"RETR download.txt" /L"EXIT"

 

The /L"EXIT" command line switch will close the application once the Initial Commands complete.

Nested Double Quotes

There are sometimes issues with getting double quotes to appear inside other double quotes through a DOS batch file.  In BlueZone Secure FTP, we have implemented a special syntax that translates into a double quote and a blank space.  The '&' translates into a double quote (") and the '%' translates into a blank space ( ).  The following is an example of using this syntax:

BZFTP.EXE /L"STOR &upload.txt& upload" /L"EXIT"

 

This would translate the STOR command to "STOR "upload.txt" upload", which would upload the local file "upload.txt" to the host as "upload".

Double Double Quotes

Some scripting and programming languages support the use of "double double quotes".  The following example shows the use of double double quotes when you are calling BlueZone Secure FTP to run from a program or script using the /Z and /L commend line switches.

Run "c:\program files\seagull\bluezone\bzftp.exe /Z0 /L""RETR F1201.CSV""

 


Related Topics:

Supported FTP Commands

Command Line Switch Table

iSeries File Transfer Using the Command Line