I wrote a bat file to install Tomcat 7.0.73 and start its service:
SET JAVA_HOME=C:\Program Files\Java\jdk1.7.0_80
CD /D Server\apache-tomcat-7.0.73\bin\
service install MyTomcat
SLEEP 5
sc start MyTomcat
But there are 2 problems:
- After service install MyTomcat, It exits and It does not perform the command sc start MyTomcat;
- How can I change the script in order to start MyTomcat in a persistent way?
service
and no commandsleep
. You would probably have to look into the documentation of those commands to figure out why it's not working the way you want and/or provide more context.service
command either, by default. So you will still need to provide context on where that command is coming from or check the help yourself, likely by runningservice /?
orservice -h
.service
is another batch file thencall
it.