How can I automate GPG on multiple files within a directory?
Posted on 2006-11-19
Hi I have several encrypted files that are uploaded to us each day using GPG.
I need to write a program or script to take each of these files and unencrypt them using GPG into a different folder for processing and remove the the encrypted ones from the original upload folder.
THen once they are processed there will be unencrypted logs about what happened during the process, I then need to take each of these files and place them into the upload folder as encrypted text files and then delete the original plaintext ones.
I have played around with c# and the Process.Start method, but this has had very mixed results. I've also looked for a gpg daemon or agent written for windows that I could schedule or that could monitor a directory and have had no luck.
I would think just a simple batch file would do this but my dos is not so good :| The part i am struggling with is how do you perform an action on one file at a time in dos, as in like a for each file in folder type cursor thing.
All of our servers are windows based, and I don't really want to use cygwin. So the solution needs to work in windows 2003!
I have got GPG set up with the certificates and can do this manually. Look forward to some help, I am sure this is quite simple but it's driving me nuts to max points to you if you solve it.