@echo off

setlocal enableextensions
cd /d %~dp0
if exist jtm\init.cmd pushd . && goto init
if exist ..\jtm\init.cmd pushd .. & goto init
goto :eof

:init
call jtm\init.cmd
goto stop_tomcat_service


:stop_tomcat_service
pushd %tomcat_dir%
net stop %tomcat_service_name%
sc delete %tomcat_service_name%
popd
echo.
goto end

:end
popd