title: Jenkins always considers a build successful using batch/bat
body: <p>I just joined a company that uses batch files to build a C++ project. The batch does all sorts of things (updates svn, which is now done by jenkins), creates build folders, deletes unnecessary files after building, copies library files to the build folder, etc.</p>
  
  <p>My problem is Jenkins always considers the build successful, even when it´s not. The .bat file creates a file called errormake.txt when something goes wrong. How do I make jenkins read that and mark the build as a failure?</p>
  
  <p>Also, is there any way I can find out the build folder Jenkins created from inside the .bat file (maybe send a variable when I call the batch file)? </p>
  
  <p>This is the single line I'm currently using to call the .bat file:</p>
  
  <pre><code>call "C:\Source\BuildVersion\AppName\build_version.bat"
  </code></pre>
  
  <p>Edit: Also, this project is split up into several SVN repositories. <code>%SVN_REVISION%</code> is blank. How can I get the correct <code>%SVN_REVISION%</code> from the first repository (the main one)?</p>