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" <[EMAIL PROTECTED]>
Sent: Tuesday, October 28, 2008 5:50 AM
To: "Salvador Torres" <[EMAIL PROTECTED]>
Cc: <[email protected]>
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 <[EMAIL PROTECTED]>:
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
[email protected]
http://lists.gnupg.org/mailman/listinfo/gnupg-users



_______________________________________________
Gnupg-users mailing list
[email protected]
http://lists.gnupg.org/mailman/listinfo/gnupg-users

Reply via email to