This script was recently written to automatically process files on our FTP server. They come in daily, in pairs, and dated with todays date, e.g. XXERUP0912.dat.pgp.
The script checks for existence, ensures a pair is found, makes sure they are the right and same date, then decrypts them and calls an external program I wrote to inject them into a SQL database for querying via ASP, which I also wrote. If any of the steps fail, it gets logged, and an email notification is sent to a number of folks.
I had a bit of an issue with expansion, but found the error of my ways in short order...
@ECHO On
SETLOCAL ENABLEDELAYEDEXPANSION
:: //////////////////////////////////////////////
::
:: Set path variables for key access, passphrase,
:: and source our key files.
SET PGPPATH=C:\PGP_Keys\
SET PGPPASS=MYPGPPASS
:: The "KEY" to a successful import of our keys is running these commands as the user
:: that will be running this script.
:: pgp +batchmode -ka %PGPPATH%SE...