gpg4win command line

Hello All,

i have installed gpg4win on my machine. our requirement is to decrypt multiple files coming from our vendor so they are usable. i have a few questions and would love to get the answers asap.

the version i am using is 2.2.5

  1. can we decrypt multiple files?
  2. i could not find an option to use the passphrase in the command line. am i missing something or has this option been taken off.
  3. can we decrypt multiple files in sub folders.

Thanks.
Nishant.

Hi Nishant,

try the option --decrypt-files, it will accept several files for decryption.
It probably accepts longer paths so you’ll be able to state files in subdirectories.
As far as I know it does not work recursive, though.

For presetting passphrases, the following tool is one good way (I’m not sure right now that gpg4win ships it):
https://www.gnupg.org/documentation/manuals/gnupg/gpg_002dpreset_002dpassphrase.html

The other option is to set an empty passphrase on the cert.

Best Regards,
Bernhard
ps.: Flattr Gpg4win at https://flattr.com/thing/2053326,
if you appreciate this answer and my work within the Gpg4win Initiative.

Hello Bernhard,

Thank you very much for your reply. While trying your suggestion and also after looking up on the internet i found 2 solutions for the problem.

decrypt-files does take multiple files but the below solution works as a wildcard if you have multiple files in your directory and this can be done unattended also.

gpg2.exe -d --multifile c:*.gpg

gpg2.exe --batch --passphrase “Your Passphrase Here” -d --multifile “c:*.gpg”

as for the Sub directories, it would only be possible using a batch script which i dont think would be much of an hassle.

Thank you again.

Nishant.