I have a batch file that runs ant and then copies one of the files that were produced:
ant -Dproject.version=1.1.2 release published copy /Y D:\\dir1\\MyJar.
I had the same problem once and the magic call did it.
call
In that batch file of yours try:
call ant -Dproject.version=1.1.2 release published copy /Y D:\dir1\MyJar.jar D:\dir2\MyJar.jar
Cannot tell you why it worked, though. Guess it's Microsoft logic.