You may be getting the result of the Powershell rather than the ping. You may want to simply exec ping.
With Powershell you may have to create a script that captures the result of the command and exits with the error indicator. If Powershell works similar to Unix/Linux/Solaris etc. shells, you are adding an additional level of abstraction. Errors often don't flow up the process stack unless you set the criteria to do so. As noted by some other posts, ping is testing the interface, not the OS. Ping can succeed even when the host OS is down or the service you want is down depending on the network card that is installed. Z W <[EMAIL PROTECTED]> wrote: Hi I have a Powershell script that contains the line "exit 2" when ping fails >From Ant, it's showing _ping: [echo] Inside _build_ping_alive module [exec] Pinging host1 ... [exec] success [exec] Pinging host2 ... [exec] error: 11010 occurred [exec] LastExitCode: 0 [exec] error.count: 0 [exec] *Result: 1* How to I capture the 1 with Ant ? In Ant, I have failonerror="false" resultproperty="build_main.debug"> Thanks ** Thank you, Chuck Holzwarth (804) 403-3478 (home) (540) 335-3171 (cell) --------------------------------- Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.