Encrypt / Decrypt Scripts

Saltorr saltorr07 at gmail.com
Wed Oct 29 04:49:18 CET 2008


Thanks Hardeep,

I think I found a very simple solution.... if the Command ends successfully 
then the ERRORLEVEL will be ZERO (0)


REM Encrypt

gpg --batch --encrypt-files -r "KEY" *.zip


echo.ERROR LEVEL: %ERRORLEVEL%

IF %ERRORLEVEL% ==0 GOTO ZERO
IF %ERRORLEVEL% ==2 GOTO TWO
IF %ERRORLEVEL% ==1 GOTO ONE

GOTO END

:ZERO
ECHO ENCRYPTION_OKAY !!!!!
del *.zip
GOTO END

:TWO
ECHO PROCESS FAIL
SEND MAIL
GOTO END

:ONE
ECHO PROCESS FAIL
SEND MAIL

:END

Regards,
Salvador Torres C.


--------------------------------------------------
From: "Hardeep Singh" <hs2412 at gmail.com>
Sent: Tuesday, October 28, 2008 5:50 AM
To: "Salvador Torres" <saltorr07 at gmail.com>
Cc: <gnupg-users at gnupg.org>
Subject: Re: Encrypt / Decrypt Scripts

> This may be of help, although it doesnt apply directly:
>
> http://blog.hardeep.name/computer/20080904/auto-gpg/
>
> Hardeep Singh
> http://blog.Hardeep.name
>
>
>
> 2008/10/28 Salvador Torres <saltorr07 at gmail.com>:
>> Hi,
>> I'm trying to run some Scripts to Encrypt and Decrypt files 
>> automatically..
>>
>> now the questions are:
>>
>> How can I delete the *.ZIP files after this command is executed without
>> errors ?
>>
>> gpg --batch --encrypt-files -r "KEY" c:\test2\*.zip
>>
>> Same case here:
>>
>> How can I delete the *.gpg files after this command is executed without
>> errors and Successfully?
>>
>> gpg --passphrase-fd 0 --batch --decrypt-files *.gpg <phrase.txt
>>
>> Thanks,
>> SalTorr
>> _______________________________________________
>> Gnupg-users mailing list
>> Gnupg-users at gnupg.org
>> http://lists.gnupg.org/mailman/listinfo/gnupg-users
>>
>> 



More information about the Gnupg-users mailing list