nant exec task: i need the return code!

  • Thread starter Thread starter prempel
  • Start date Start date
P

prempel

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
 
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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top