Please note that there are two levels of execution:
- Ant calls
cmd.exe . cmd.exe performs the DIRSS .
You see that if the second step failed, this does not necessarily mean that cmd.exe propagates the error back to Ant. This may be more obvious if you mentally replace the famous cmd.exe with something "innocent", for example foo.exe .
So, the next step is to study why the second step behaves differently on your machine than on the machines of the commentators of your question. Once this puzzle is solved, you can return to the Ant question.
The first step might be: Open a new shell window and try
> cmd /c dir > echo %ERRORLEVEL% > cmd /c dir nonexisting-directory > echo %ERRORLEVEL% > cmd /c dirr > echo %ERRORLEVEL%
Also tell us the version of your OS.
source share