Removing all statements after the command solved the problem. I don't believe there is a bug with cmd.exe, I think it's just the design of the ERRORLEVEL variable in batch files. Thank you very much for your insight on this, I was totally stuck and I truly appreciate your help! Michaël >So, I'm unable to reproduce any kind of a bug. As you can see, Ant gets >the result of the batch file errorlevel. In my case, I don't have any >other commands after the command causing the error. > >Then I added: echo ERRORLEVEL=%ERRORLEVEL% to the end of the batch file >and the build stopped failing. The real bug it appears is in your batch >file. Don't have any other commands after the command that could cause >the error you're interested in. Even a REM or ECHO command will change >the exit status!!! Note that I said "exit status" and not errorlevel. It >appears the exit status of a program is copied to errorlevel. However, >when the batch file exits it uses the exit status NOT errorlevel. Looks >like a bug in cmd.exe to me. _________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.