I am running Tomcat as an NT service. How do I write a command file or a batch file that should run a Java class (or a jar file) and restart the Tomcat service (so that the java class results can take effect)?

Michael Lantzen

You can do a youscript.cmd file and put 4 lines into it

cd directorywithYourClass
java YourClass
net stop Tomcat
net start Tomcat

that's it, assuming that you named your service Tomcat.

0 Comments  (click to add your comment)
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.