471,348 Members | 1,357 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,348 software developers and data experts.

nant exec task: i need the return code!

Hi, I couldn't find a nant user group here, so thought i'd try this.

I run an external program from nant (robocopy) and unfortunately, it
returns 1 on success. Nant interprets this as a failure. I want it to
continue when it gets a 1 back (and possibly certain other codes), but
fail otherwise. I know I could use failonerror=false but then it would
still continue even during a real error.

Is there a way to capture the return code into a variable when using
the <exec> nant task?

- Paul

Feb 15 '06 #1
1 4041
<pr*****@gmail.com> wrote:
Hi, I couldn't find a nant user group here, so thought i'd try this.

I run an external program from nant (robocopy) and unfortunately, it
returns 1 on success. Nant interprets this as a failure. I want it to
continue when it gets a 1 back (and possibly certain other codes), but
fail otherwise. I know I could use failonerror=false but then it would
still continue even during a real error.

Is there a way to capture the return code into a variable when using
the <exec> nant task?


Aside from any other options - couldn't you write a batch file or small
executable which launches another executable and does the appropriate
error code changing?

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Feb 15 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by hoochiegooch | last post: by
2 posts views Thread by HaukiDog | last post: by
reply views Thread by muesliflakes | last post: by
3 posts views Thread by prabhupr | last post: by
4 posts views Thread by harleybl | last post: by
3 posts views Thread by Me | last post: by
12 posts views Thread by michael sorens | last post: by
reply views Thread by james.mcdonagh | last post: by
1 post views Thread by John A Grandy | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.