Command Line PGP with Variable File Name

Command Line PGP with Variable File Name

Post by paulmac10 » Sun, 12 Jun 2005 05:13:23


Hi,

does anyone know how to pass the batch file a variable file name so
that it encrypts?

It works fine with a static file name, but my file name changes daily.

thanks,
paul
 
 
 

Command Line PGP with Variable File Name

Post by Klaus Petr » Sat, 27 Aug 2005 07:33:24


Try this in a batch file 'encrypt.bat'

C:\Programs\PGPcmd\pgp.exe -e %1 0xXXXXXXXX
if errorlevel 1 pause

For 0xXXXXXXXX take the number of the desired keyID
The available keyIDs you can find out with the DOS-command pgp -kv
It works fine with my pgp 6.5.8 command line version under XP Pro.
Correct the part 'c:\programs\pgpcmd' according to your installation.

To decrypt any file have this in 'decrypt.bat'

C:\Programs\PGPcmd\pgp %1
if errorlevel 1 pause

Then you'll be prompted for the pass word and then pgp decrypts the
desired file.

Best regards
Klaas