anchor.diff:  
   :doRemove
   rem Remove the service
  -"%EXECUTABLE%" //DS//%SERVICE_NAME%
  +echo Removing the service '%SERVICE_NAME%' ...
  +echo Using CATALINA_BASE:    "%CATALINA_BASE%"
  +
  +"%EXECUTABLE%" //DS//%SERVICE_NAME% ^
  +    --LogPath "%CATALINA_BASE%\logs"
   if not errorlevel 1 goto removed
   echo Failed removing '%SERVICE_NAME%' service
   goto end
  
positive.code: echo Using JAVA_HOME:        "%JAVA_HOME%"
  echo Using JRE_HOME:         "%JRE_HOME%"
  
  rem Use the environment variables as an example
  rem Each command line option is prefixed with PR_
  
  set PR_DESCRIPTION=Apache Tomcat @VERSION@ Server - http://tomcat.apache.org/
  set "PR_INSTALL=%EXECUTABLE%"
  set "PR_LOGPATH=%CATALINA_BASE%\logs"
  set "PR_CLASSPATH=%CATALINA_HOME%\bin\bootstrap.jar;%CATALINA_BASE%\bin\tomcat-juli.jar;%CATALINA_HOME%\bin\tomcat-juli.jar"
  rem Set the server jvm from JAVA_HOME
  set "PR_JVM=%JRE_HOME%\bin\server\jvm.dll"
  if exist "%PR_JVM%" goto foundJvm
  rem Set the client jvm from JAVA_HOME
  set "PR_JVM=%JRE_HOME%\bin\client\jvm.dll"
  if exist "%PR_JVM%" goto foundJvm
  set PR_JVM=auto
  set PR_STDOUTPUT=auto
  set PR_STDERROR=auto
  :foundJvm
  echo Using JVM:              "%PR_JVM%"
  "%EXECUTABLE%" //IS//%SERVICE_NAME% ^
      --StartClass org.apache.catalina.startup.Bootstrap ^
      --StopClass org.apache.catalina.startup.Bootstrap ^
      --StartParams start ^
      --StopParams stop ^
      --JvmOptions "-Dcatalina.base=%CATALINA_BASE%;-Dcatalina.home=%CATALINA_HOME%;-Djava.endorsed.dirs=%CATALINA_HOME%\endorsed;-Djava.io.tmpdir=%CATALINA_BASE%\temp;-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager;-Djava.util.logging.config.file=%CATALINA_BASE%\conf\logging.properties" ^
      --StartMode jvm ^
      --StopMode jvm ^
      --JvmMs 128 ^
      --JvmMx 256
  if not errorlevel 1 goto installed
  echo Failed installing '%SERVICE_NAME%' service
  goto end
  :installed
  rem Clear the environment variables. They are not needed any more.
  set PR_DISPLAYNAME=
  set PR_DESCRIPTION=
  set PR_INSTALL=
  set PR_LOGPATH=
  set PR_CLASSPATH=
  set PR_JVM=
  echo The service '%SERVICE_NAME%' has been installed.
  
  :end
  
negative.code: if "x%1x" == "x/userx" goto runAsUser
  if "x%1x" == "x--userx" goto runAsUser
  set SERVICE_NAME=%1
  set DISPLAYNAME=Apache Tomcat %1
  shift
  if "x%1x" == "xx" goto checkServiceCmd
  goto checkUser
  