Get the latest beta version of ant 1.5 because a bug was fixed for WinXP.
I had the same problem when building the examples and patched ant 1.4.1 (locally) to work with WinXP (I also verified that the fix appears in ant 1.5). Basically the problem occurs when the task is executed. Ant 1.4.1 won't understand what OS you are running on (it only tests for Windows 2000 and NT) and it will fail.
Hope that helps,
Thanks it was a great help from me.