Quite simply, how does one determine whether or not Tomcat is running in Windows, using the command prompt?
I am writing a batch script that must do this. This is
You could use tasklist to check if the tomcat executable is running. For example:
@echo off
tasklist /FI "IMAGENAME eq tomcat.exe" | find /C /I ".exe" > NUL
if %errorlevel%==0 goto :running
echo tomcat is not running
goto :eof
:running
echo tomcat is running
:eof
It is also possible to check a remove server using the options /S
, /U
and /P
. See tasklist /?
for details.