AW: WINDOWS - Adding passphrase to gpg via command line

Mike Kaufmann m.kaufmann at
Wed Jun 15 14:06:30 CEST 2016

Hi Peter

Thank you very mutch, that did the trick for the Windows command line! 
The commands are now executed successfully. But unfortenately when I try to sign the file the pinentry dialog still appears :(

I've also tried to put all the commands in one single command combined with the &-operator. Also this command runs successfully, but the pinenetry dialog is shown always.
gpgconf --kill gpg-agent & gpg-connect-agent "preset_passphrase C9FE2B0938FC146E088A9D563AED4892A6ACB6FB -1 74657374" /bye & gpg --homedir c:\ESA\EIOPA\PreProd\DCCR --output "C:\ESA\EIOPA\Export\LI001_DATPPP_EIOPA_000001_16.asc" --armor -u vve at --digest-algo SHA512 --sign "c:\ESA\EIOPA\LI001_DATPPP_EIOPA_000001_16.csv"

In the attachement you can see the executed commands (Passphrase 74657374 is the hex equivalent of "test" and is replaced, when I run the command).

Any further ideas? I am despairing slowly but surely...

Regards, Mike

-----Ursprüngliche Nachricht-----
Von: Peter Lebbing [mailto:peter at] 
Gesendet: Mittwoch, 15. Juni 2016 13:17
An: Mike Kaufmann <m.kaufmann at>
Cc: gnupg-users at
Betreff: Re: WINDOWS - Adding passphrase to gpg via command line

On 15/06/16 08:33, Mike Kaufmann wrote:
> See also the attached screenshot. Do you habe any other ideas?

You're missing some necessary quoting. Right now, you're sending four separate commands instead of a single command with three options!

gpg-connect-agent 'preset_passphrase 74EC3FAA93CD49446EC6825C3EBEB2C336CCBE2A -1 4D7950617373706872617365' /bye

should do the trick. Or if the Windows command line doesn't like quoting with apostrophes, you could do

gpg-connect-agent "preset_passphrase 74EC3FAA93CD49446EC6825C3EBEB2C336CCBE2A -1 4D7950617373706872617365" /bye



I use the GNU Privacy Guard (GnuPG) in combination with Enigmail.
You can send me encrypted mail if you want some privacy.
My key is available at <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: GnuPGpressetpassphraseWinCmd.png
Type: image/png
Size: 19247 bytes
Desc: GnuPGpressetpassphraseWinCmd.png
URL: </pipermail/attachments/20160615/331f823c/attachment-0001.png>

More information about the Gnupg-users mailing list