您可以使用任务列表检查tomcat可执行文件是否正在运行。例如:
@echo offtasklist /FI "IMAGENAME eq tomcat.exe" | find /C /I ".exe" > NULif %errorlevel%==0 goto :runningecho tomcat is not runninggoto :eof:runningecho tomcat is running:eof
也可以检查使用的选项删除服务器
/S,
/U和
/P。有关
tasklist /?详细信息,请参见。



