1

Possible Duplicate:
How to check if a service is running via batch file and start it, if it is not running?
Determine if Tomcat is running in Windows using the command prompt

Is there a way to check if Tomcat service (or any service for that matter) is running/stopped in Windows OS through a Java program running through Windows scheduler? If stopped I have to start that service?

Community
  • 1
  • 1
Shiva
  • 599
  • 1
  • 6
  • 21
  • possible duplicate of [How to check if a service is running via batch file and start it, if it is not running?](http://stackoverflow.com/questions/3325081/how-to-check-if-a-service-is-running-via-batch-file-and-start-it-if-it-is-not-r) and http://stackoverflow.com/questions/6220196/determine-if-tomcat-is-running-in-windows-using-the-command-prompt – KV Prajapati Aug 29 '12 at 07:18

1 Answers1

0

Not sure what the tomcat process looks like. If it is something like tomcat.exe then you could use the solution in the question to get the processes. How to get a list of current open windows/process with Java? and then do a search for the process name

Community
  • 1
  • 1
RNJ
  • 15,272
  • 18
  • 86
  • 131