another windows batch question

Chris Fox dissectingtable at comcast.net
Fri Feb 6 15:44:51 CET 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jonathan Goulding wrote:

| Hi,
|
| I would like to avoid the 2 following:
|
| 1. writing data to/from files;
| 2. using named pipes to have a program interact with gpg
|
| So is it possible to call a batch file passing it both the data to be
| encrypted/decrypted and the passphrase, so I don't first have to write
| the data to a file and then call the batch?
|
| -Jonathan Goulding
|
| P.S. The reason #2 is not satisfactory is that I am using VB and I
| understand that task is quite difficult/impossible to do in VB.  Also, I
| am a law student, not a programmer; so, while I enjoy teaching myself
| how to program, I would hardly describe myself as a prodigy.

If you always encrypt to the same recipient you can add a
default-recipient line in your gnupg.conf file and your batch file
reduces to:

@echo off
if "%1" == "" goto syntax
type %1 | gpg -ea > %1.gpg
goto done
:syntax
echo syntax: enc filename
echo writes filename.gpg
:done

If you don't have a default recipient it will prompt you on stderr and
the batch file still works.
- --
Chris Fox, Windows User, Linux User (#341856), non-partisan
"[The multiplicity of reality at large] is an inescapable consequence of
[quantum theory's] allowing superpositions of what classical physics
would regard as mutually exclusive alternatives."
~ -- Michael Lockwood /Brit. J. Phil. Sci./ (1995)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFAJCbz9jaRInQzvmsRAv7BAJ9TAf6CMH8Tt2nwINv2qIS2XQvs1wCfcsJZ
wjCO//42cRQWbTKGOgklAcSIPwMFAUAkJvO2gOp1BO9b9hEC/sEAnjXzODwHzMVg
P+XabDsetyGO2ENQAJ4l4Vzm+lxXWGNMg9mt3yIEXWp58Q==
=zmlA
-----END PGP SIGNATURE-----




More information about the Gnupg-users mailing list