Batch Script: gpg2 decrypt hangs when it is used with 'for files' on command line

560 views Asked by At

I want to decrypt all .pgp files present in a folder. Assuming the folder has .pgp files only, I am using the following command to automate the task:

forfiles /p "D:\sourcing" /c "cmd /c D:\PGP\GnuPG\gpg2 --batch --passphrase abcxyz--output @path\@fname --decrypt @path\@file"

But this command hangs on the terminal.

I am able to decrypt one file at a time using the same gpg2 command eg: Below command just works fine.

D:\PGP\GnuPG\gpg2 --batch --passphrase abcxyz --output D:\sourcing\abc.txt --decrypt D:\sourcing\abc.pgp
0

There are 0 answers