把Tomcat注册为windows service 的bat

echo off
cd /d D:\apache-tomcat-7.0.25\bin

SC QUERY Tomcat7

echo %errorlevel%

if %errorlevel% == 0 (goto re) ELSE (goto continue)
:re
call service.bat remove
call service.bat install
net start Tomcat7
goto :eof
:continue
call service.bat install
net start Tomcat7

你可能感兴趣的:(tomcat)