title: Running a Windows batch file in Jenkins
body: <p>I trying to run my Tests cases for a project in Jenkins through DOS Command line on Windows server . I am using Jenkins ver. 1.559.</p>
  
  <p>I am trying to run a Windows batch file through a Jenkins job that has the java command.</p>
  
  <pre><code>Under the "Build" section &gt;&gt; "Execute Windows Batch command" &gt;&gt; Command: call E:\Jenkins\App\UnitTests\App_UnitTests.bat 
  </code></pre>
  
  <p>Save and Build the job.</p>
  
  <p>I am getting an error and here is my Console Output</p>
  
  <pre><code>C:\Program Files (x86)\Jenkins\jobs\App Test Cases\workspace&gt;java.exe -cp "E:\Jenkins\App\PPS\App\bin\;E:\Jenkins\App\PPS\App\lib\junit-4.10.jar;E:\Jenkins\App\PPS\App\lib\*.jar;" org.junit.runner.JUnitCore com.omnitracs.fra.junit.EventTests 
  'java.exe' is not recognized as an internal or external command, operable program or batch file.
  
  C:\Program Files (x86)\Jenkins\jobs\App Test Cases\workspace&gt;PAUSE
  Press any key to continue . . . 
  
  C:\Program Files (x86)\Jenkins\jobs\App Test Cases\workspace&gt;EXIT
  Build step 'Execute Windows batch command' marked build as failure
  Finished: FAILURE
  </code></pre>
  
  <p>The java command runs fine outside Jenkins.
  I have set the JAVA_HOME for the local user and also the PATH variable to point to where java.exe is.</p>
  
  <p><img src="https://i.stack.imgur.com/soeWR.jpg" alt="enter image description here"></p>
  
  <p><img src="https://i.stack.imgur.com/mSOv1.jpg" alt="enter image description here"></p>
  
  <p>What am I doing wrong? Please help.</p>