title: How does Tomcat set its executable file as a Windows service?
body: <p>Firstly, I am not at all familiar with Windows batch file programing. Recently I am curious about how <a href="http://en.wikipedia.org/wiki/Apache_Tomcat" rel="nofollow noreferrer">Tomcat</a> sets itself as a Windows service using a batch file. I downloaded the <strong>service.bat</strong> file from Tomcat 6. However, I still don't understand some part of it.</p>
  
  <p>I guess this is the line that the batch actually register the EXE file to the OS, is it right? Is there any syntax explanation?</p>
  
  <pre><code>"%EXECUTABLE%" //IS//%SERVICE_NAME% --StartClass org.apache.catalina.startup.Bootstrap --StopClass org.apache.catalina.startup.Bootstrap --StartParams start --StopParams stop
  </code></pre>
  
  <p>And is this used to remove the service?</p>
  
  <pre><code>"%EXECUTABLE%" //DS//%SERVICE_NAME%
  </code></pre>
  
  <p>And this is the setting of the parameters?</p>
  
  <pre><code>"%EXECUTABLE%" //US//%SERVICE_NAME% --JvmOptions "-Dcatalina.base=%CATALINA_BASE%;-Dcatalina.home=%CATALINA_HOME%;-Djava.endorsed.dirs=%CATALINA_HOME%\endorsed" --StartMode jvm --StopMode jvm
  </code></pre>