BlueZone Secure FTP and batch files
BlueZone Secure FTP can be launched from a DOS batch file. Because BlueZone Secure FTP has support for command line switches, it is possible to control the launching of BlueZone Secure FTP.
Basic examples
If you want to launch BlueZone Secure FTP from a batch file and include a configuration file named config.zft to start the BlueZone Secure FTP session, use there /F command line switch:
"C:\Program Files\BlueZone\BZFTP.EXE" /Fconfig.zft
If you want to launch BlueZone Secure FTP from a batch file and set the “Initial PC Directory" to a folder called C:\MyFiles, use the /I command line switch:
"C:\Program Files\BlueZone\BZFTP.EXE" /Ic:\MyFiles
You can also combine command line switches in one statement. The following example combines the two examples above:
"C:\Program Files\BlueZone\BZFTP.EXE" /Fconfig.zft /Ic:\MyFiles
Other examples
Initial commands (/L command line switch) are used to configure FTP to perform specific FTP commands upon connect. For example, if you want to configure BlueZone Secure FTP 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 closes BlueZone Secure FTP once the initial commands complete. There are sometimes issues with getting double quotes to appear inside other double quotes through a batch file. In BlueZone Secure FTP, there are two characters that translate into double quote and a blank space. The ampersand symbol (&) translates into a double quote (") and the percent sign (%) translates into a blank space ( ). The following is an example:
BZFTP.EXE /L"STOR &upload.txt& upload" /L"EXIT"
This translates the STOR command to "STOR "upload.txt" upload", which uploads the local file upload.txt to the host as "upload".
Note
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\BlueZone\BZFTP.EXE /Z0 /L""RETR F1201.CSV""