dealing with password in batch file

Sean Cerney sean_cerney at
Fri Apr 21 20:11:07 CEST 2006


I've been decrypting xml files for a while now with a batch file that 
converts the pgp file into an xml file with a timestamp.

The thing is I always have to manually enter the password each time I run 
the batch file.  I want to automate this thing once and for all, but I have 
to figure out how to incorporate password entry into the batch file.  I try 
to echo the password but that has no effect.  I am using DOS command line.

Any suggestions?  Thank you.

Here is basically what I have at the moment..(actual drive name and 
subfolders omitted)

DriveName:\SubFolders --output DriveName:\SubFolders\ScheduledExtract.xml 
--decrypt DriveName:\SubFolders\*.xml.pgp

@echo off
:: variables
set hour=%time:~0,2%
if "%hour:~0,1%"==" " set hour=0%time:~1,1%
set NewFileName=%date:~10,4%_%date:~4,2%_%date:~7,2%_%hour%_%time:~3,2%

RENAME ScheduledExtract.xml ScheduledExtract%NewFileName%.xml

once this runs it prompts for the password

Is your PC infected? Get a FREE online computer virus scan from McAfee® 

More information about the Gnupg-users mailing list