Sample scripts are provided as-is with no warranty of fitness for a particular purpose. These scripts are solely intended to demonstrate techniques for accomplishing common tasks. Additional script logic and error-handling may need to be added to achieve the desired results in your specific environment.
Many Robo-FTP script commands, such as PGPDECRYPT, are designed to operate on a single file and therefore do not support using wildcards.
You can still use these commands with files where the file name is not known ahead of time by combining them with GETFILE, FTPGETFILE, GETNEXTFILE, GETSITEFILE and related commands that are designed to scan local or remote directories and return information about the files it finds.
This sample script connects to a remote FTP server and uses GETSITEFILE to return information about each file it finds. It then downloads and decrypts each file.
See the Help file for more details on the usage of these commands.
1 FTPLOGON "IP Address" /user=username /pw=password 2 IFERROR GOTO Disconnect 3 :loop 4 GETSITEFILE "*.pgp" /oldest 5 IFERROR= $ERROR_NO_FILE_FOUND GOTO Disconnect 6 RCVFILE %sitefile /delete 7 IFERROR GOTO Disconnect 8 PGPDECRYPT %sitefile "" /pw=keypassphrase 9 IFERROR GOTO Disconnect 10 GOTO loop 11 :Disconnect 12 FTPLOGOFF 13 EXIT