Using the %pgpdecryptfile Variable |
Top Previous Next |
The value of the %pgpdecryptfile variable is set by the PGPDECRYPT command. This variable is useful in scripts that attempt to recover the original file name (the name prior to encryption) by passing an empty string to the second argument of the PGPDECRYPT command.
In the following example, files with a ".pgp" extension are downloaded and decrypted. The decrypted file created as the output of the PGPDECRYPT command is then renamed using the current system time followed by the original file name. Finally, the encrypted version of the file is deleted.
FTPGETREWIND :loop FTPGETFILE "*.pgp" ;; populates the %sitefile variable IFERROR GOTO done RCVFILE %sitefile PGPDECRYPT %sitefile "" /pw="secret!!!" SET new_name = %datetime + "_" + %pgpdecryptfile RENAME %pgpdecryptfile new_name DELETE %sitefile GOTO loop :done
Related command(s): PGPDECRYPT See also: Internal Script Variables |