Friday, October 03, 2008

Awwwwww, crap!

After all the work I did on these batch files that decrypt PGP files, and un-tar the contents, I've found an error, and a pretty major *duh* one at that.

Seems my logic was way off when it came to doing some date checking. Since the files I check have a naming convention that uses the previous days date, I was simply subtracting one from %TODAY%. Seems ok, right?


This is the *duh* part. I simply subtracted 1. From 1001, that makes 1000. That's not a day, when you are using MMDD as the convention. What I was looking for was 930. NOT the same.

SSSssoooooo, I added a bit I found on Experts Exchange (THANK you..for saving me MUCHO time).

I was also having some issues trapping the ERRORLEVEL. Apparently, since FOR loops in DOS batch scripts are executed as one command, PGP never has a chance to pass it's exit code to my IF check, so this was also modified.

The modded file is here.

No comments: