Yet another Windows batch question

Chris Fox dissectingtable at
Fri Feb 6 19:22:48 CET 2004

Hash: SHA1

Kevin Flanagan wrote:

| I'm trying, on a Windows system to do encryption of a file and logging
| the output to a log file, that will be used by the user, and later
| administrators or auditors to verify the process.  Something like this.
| gpg -e -v -r joe.blow at -o foo.pgp %1 > foo.log
| I need to make the output be .pgp extention, this part works just fine.
| The log file is the issue, it creates foo.log, but the output of the
| gpg command isn't there.

It seems as though gpg reserves stdout for formatted data; every time I
redirect a successful gpg call I get the en/decrypted material coming out.

Seems like messages you'd want to save come out stderr, in which case
you want to change your script to

| gpg -e -v -r joe.blow at -o foo.pgp %1 2> foo.log

Note the 2 before the >

I just tried it and it works.

- --
Chris Fox, Windows User, Linux User (#341856), non-partisan
Since free markets lead directly to monopoly, oligarchy, poverty,
unemployment, and Fascism, they cannot be said to "work" in any
meaningful sense.
Version: GnuPG v1.2.4 (MingW32)
Comment: Using GnuPG with Mozilla -


More information about the Gnupg-users mailing list