Tomcat 注册成为 Windows 服务,指定可执行文件的路径

cd %TOMCAT_HOME%\bin

service.bat install file  -- 注册服务,名称:file。需要提前把 tomcat8w.exe 修改为 filew.exe

此时发现,可执行文件的路径是 tomcat8.exe。运行的时候,在任务管理器中映像名称也就是 tomcat8.exe;如果注册多个 tomcat 服务时,不易区分

 

修改上述 tomcat8.exe 为 file.exe,有以下两个方式,事先复制 tomcat8.exe,新的文件改名为:file.exe

1)首先需要移除服务:service.bat remove/uninstall file  -- 移除名字为 file 的服务

替换 service.bat 中 set "EXECUTABLE=%CATALINA_HOME%\bin\file.exe" 中的 tomcat8.exe 为 file.exe

注册服务:service.bat install file

2)在注册表中找到服务 file (HKEY_LOCAL_MACHINE\SYSTEM\*\services\file),修改 ImagePath 中 tomcat8.exe 为 file.exe

 

posted @ 2018-01-16 10:17  zhiqsyr  阅读(489)  评论(0编辑  收藏  举报