You should just be able to use simple checks for the ERRORLEVEL variable to
do some basic if blocks. See
http://stackoverflow.com/questions/4451013/check-if-process-returns-0-with-batch-file
for
a basic example and also I think it has a link to more info.

Richard.

On Fri, 15 Apr 2016 at 09:40 Scott Richmond <s.t.richm...@gmail.com> wrote:

> So I've done some testing - One can catch a bad exit from bat with a
> trycatch function. HOWEVER! It does not seem to catch exit code 1. It'll
> catch other higher numbered exit codes, but not 1. Not sure what to do here.
>
> On Thu, Apr 14, 2016 at 10:25 PM, Richard Bywater <rich...@byh2o.com>
> wrote:
>
>> Someone may have a more elegant answer but one way that comes to mind is
>> to call another cmd/bat file from Jenkins which then calls the external
>> tools and also has logic to interpret the exit codes coming back from the
>> those tools and acting appropriately.
>>
>> Richard.
>>
>> On Fri, 15 Apr 2016 at 09:07 Scott Richmond <s.t.richm...@gmail.com>
>> wrote:
>>
>>> I need to run a few external build tools and I do so with the bat
>>> command on Windows agents. I need to be able to determine the success or
>>> failure of that command based on the exit code of the script that was run.
>>> Is it possible to get this?
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Jenkins Users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to jenkinsci-users+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/jenkinsci-users/b1f502b2-e559-49d9-a9b3-7d33f4fa89ae%40googlegroups.com
>>> <https://groups.google.com/d/msgid/jenkinsci-users/b1f502b2-e559-49d9-a9b3-7d33f4fa89ae%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Jenkins Users" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/jenkinsci-users/Dr1u9PVUvVw/unsubscribe
>> .
>> To unsubscribe from this group and all its topics, send an email to
>> jenkinsci-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/jenkinsci-users/CAMui947b10_P7J_-GiEXAVUwNZGPSYGvsGGeHpZ2%2BdXWOOUZJw%40mail.gmail.com
>> <https://groups.google.com/d/msgid/jenkinsci-users/CAMui947b10_P7J_-GiEXAVUwNZGPSYGvsGGeHpZ2%2BdXWOOUZJw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>
>
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/CAEwxhEtcUz%2BHLvuakQuvrDnSNT9sAG182Z%2B_ccXJrjWR6RFj2Q%40mail.gmail.com
> <https://groups.google.com/d/msgid/jenkinsci-users/CAEwxhEtcUz%2BHLvuakQuvrDnSNT9sAG182Z%2B_ccXJrjWR6RFj2Q%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAMui945BTxcz9aBjGWAuHh5kHMZxV0W6SxiZoJq6n6b%2BA5%2BzNA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to