The amount of useful and helpful information in the README file for gpg4win is almost equal to the number of pink elephants sitting on my desk right now. I managed to finally piece it together and figure out how to pipe the passphrase into it. Here’s how I did it and what worked for me.
echo passphrase|gpg --batch --passphrase-fd 0 --output filename.txt -d c:\path\*.gpg
– If I remember correctly, you need to use the –batch switch in order for it to work correctly in Scheduled Tasks.
– The “-d” argument tells it to decrypt.
– If you either pipe your passphrase to gpg and don’t include the “–passphrase-fd 0” switch or vice versa, you will still be prompted to enter your passphrase when the script runs. You must pipe the passphrase at the beginning AND include the –passphrase switch.
– The “–passphrase-fd” switch isn’t included in the -help list in the command-line, so if you’re having trouble automating it, this is probably the piece you’re missing.
Other than that, I can’t seem to find my documentation on why that particular set of switches works for me. The README file is useless and the Novice manual doesn’t include anything about command-line switches. I know there is a comprehensive list somewhere out there on the internets, so if anyone has run across it, please post the link in a comment and I’ll update this post.