Well I haven't done any batch file programming in about a decade, so I'm a little rusty. For example, I had forgotten about this little gem:
if errorlevel 0 goto dosomething
In this case, "errorlevel" doesn't do what you would expect it to. You would think that if errorlevel was equal to zero, then the "goto dosomething" would happen. According to Microsoft's infinite wisdom, checks for errorlevel are for "equal to or greater than". Therefore in this case if the return value was 63 it would still evaluate to true. In fact, in EVERY case the if statement would evaluate to true (DOS doesn't support negative exit codes). Doh.
The irony of course, is that I'm doing this at all. Sure I had to look up some of the nuance of the syntax, but it's not like there is some shortage of documentation on the Interweb for batch file programming. I had to write a series of examples for the customer demonstrating how to use exit codes and environment variables. Surely there has to be some better use of my time?