Automate service start/stop

  • Thread starter Thread starter Ron
  • Start date Start date
R

Ron

Is there a way to automate the starting and stopping of
an apache tomcat service? Would like to have it stop and
restart every monring.
 
Is there a way to automate the starting and stopping of
an apache tomcat service? Would like to have it stop and
restart every monring.


Open a CMD prompt and type net start while the service is running.
locate the exact name of the service in the list resturned.
If it is "Appache Tomacat Service", as an example, the
create a batch job:

@echo off
net stop "Appache Tomacat Service"
net start "Appache Tomacat Service"


Schedule the batch to run in the local system account:

AT 07:00 /every:M,T,W,Th,F,S,Su c:\folder\batchname.bat



Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com
 
I'd add a pause/sleep command to have it wait fro a few seconds. Just in
case. I've seen services (Print Spooler is one) that fail to start when I
manually try to "Restart" the service.
 
Back
Top