empty file generated when running GPG batch

jb1111 johnathan.barbett at elephant.com
Thu Mar 24 15:07:00 CET 2011


Hi.  It outputs a same named .pgp file.  When decrypted, it's empty.  I tried
removing the echo before, "Password" and that breaks the process.  Sorry, I
haven't done batch in years and gpg is a new thing for me.  Result:

C:\outgoingdropfolder>FOR /F "delims=" %F IN ('MORE <
"C:\Users\myprofile\AppData\Local\Temp\~encryptlist.txt"') DO (
IF EXIST %F (
Echo Password  | GPG --batch --encrypt --passphrase-fd 0 -r Publickeyuid -o
"C:\encryptedfiles\%F.pgp"
IF ERRORLEVEL 0 DEL "%F"
)
)
C:\outgoingdropfolder>(
 IF EXIST test345.txt (
 Echo Password  | GPG --batch --encrypt --passphrase-fd 0 -r Publickeyuid -o
"C:\encryptedfiles\test345.txt.pgp"
 IF ERRORLEVEL 0 DEL "test345.txt"


Jerome Baum-2 wrote:
> 
> jb1111 <johnathan.barbett at elephant.com> writes:
> 
>> Hi, this is running in a batch.  It creates a .pgp file, however that
>> file is
>> empty.  Any ideas?
>>
>> SETLOCAL
>> PATH=C:\Program
>> Files\GNU\GnuPG;c:\encryptedfiles;c:\outgoingdropfolder;%PATH%
>>>"%TMP%\~encryptlist.txt" DIR /B "C:\outgoingdropfolder"
>> PUSHD "C:\outgoingdropfolder"
>> pause
>> FOR /F "delims=" %%F IN ('MORE ^< "%TMP%\~encryptlist.txt"') DO (
>> pause
>> IF EXIST %%F (
>> pause
>> ECHO Password|GPG --batch --encrypt --passphrase-fd 0 -r Publickey -o
>> "C:\encryptedfiles\%%F.pgp"
>> pause
>> IF ERRORLEVEL == 0 DEL "%%F"
>> )
>> )
>> POPD
>> DEL "%TMP%\~encryptlist.*"
>> ENDLOCAL
> 
> What does it output? Also, sure you want to echo in the password? Seems
> like it's not necessary.
> 
> -- 
> PGP: A0E4 B2D4 94E6 20EE 85BA E45B 63E4 2BD8 C58C 753A
> PGP: 2C23 EBFF DF1A 840D 2351 F5F5 F25B A03F 2152 36DA
> 
>  
> _______________________________________________
> Gnupg-users mailing list
> Gnupg-users at gnupg.org
> http://lists.gnupg.org/mailman/listinfo/gnupg-users
> 
> 

-- 
View this message in context: http://old.nabble.com/empty-file-generated-when-running-GPG-batch-tp31223498p31228406.html
Sent from the GnuPG - User mailing list archive at Nabble.com.




More information about the Gnupg-users mailing list