I am facing the following issue and would really appreciate some help since I am a newcomer to windows systems:
I am writing a script which launches an executable at some point. This executable is likely to fail and I would like my batch file to stop running in this case. My researches led me to the following link: Does Windows batch support exception handling? (first answer).
The problem with this answer is that it seems (unless I am misled) to work only when the called target's source code is reachable. Anyway the solution seems really complicated for what I would like to do. Is there a more straightforward way to detect a failure (being able to capture the error message or to use the errorcode would be more than enough) ? You may have a look at the enclosed screenshot for a better understanding of the issue.
Thank you for your help, hope this will be useful to more than one, regards
Appendix:
This first image shows the error message I would like to capture:
This one shows the part of the script where I call the executable:
On the second image, the findstr instruction is used to look for a particular sentence in a logs file, if the sentence is found then we can assume the execution has been successful, otherwise we cannot conclude. This is a rather perfunctory solution...