title: Restart Tomcat using bat file Windows
body: <p>I have a Jenkins script which needs to restart the server after deploying the war file. <br>
  the script has three steps <br>
  <code>%CATALINA_HOME%\bin\shutdown.bat &amp;&amp;
  copy %JENKINS_HOME%\Project\Web.war %CATALINA_HOME%\webapps\ &amp;&amp; 
  %CATALINA_HOME%\bin\startup.bat
  </code>
  <br>
  However, if the system is not running there is error like this:
  <code>
  Tomcat may not be running. 
  java.net.ConnectException: Connection refused: connect
  </code>
  I need a way to restart the tomcat safely even if the server is not running.</p>