Problem trying to automate decrypt option

Gabi gabi at
Wed Oct 17 14:56:57 CEST 2012

We want to automate the decrypt process in some file with a task in the
operating system (Windows 7 64)

What we want to do is from command line is: gpg2.exe --decrypt file.gpg >
result.txt Of course it works ok, but launch pinentry.exe, a dialog box to
ask for the password of the certificate.

So we use a pipeline to send the password to gpg2 like this:

echo "myPassword" | gpg2.exe --decrypt file.gpg > result.txt

But this does not work.

One possible workaround is that once we have put the password in the
pinentry.exe dialog, we can decrypt again WITHOUT using the password and
after some time (some minutes) gpg2.exe ask us for a password again.(For
example after writing password if we run the same bat with the same command
it does not ask us for a some minutes at least)

So there could be 2 possible solutions we don't know how to implement.
1) A way to send the password to the dialog, the command echo "myPassword" |
gpg2.exe --decrypt file.gpg > result.txt was supposed to work, we find it in
a forum, but it does not work.
2) Can we change the time it ask again for the password? Where? How? If we
can set it to, for example 1 year, the we can run the command, type the
password in the dialog box and use the same command in a daily task and
it'll work until next year...

Has anybody an answer for 1) or 2)? Any of them will solve the problem...


More information about the Gnupg-users mailing list