Reputation: 229
Hi I have a problem with the below commands.
REM : Start server
C:
cd C:\Apache Software Foundation\apache-tomcat-7.0.22\bin
CALL shutdown.bat
cd C:\Apache Software Foundation\apache-tomcat-7.0.22\webapps
RMDIR ProjectWAR /S /Q
DEL ProjectWar.war
cd C:\Apache Software Foundation\apache-tomcat-7.0.22\bin
catalina jpda start
I am trying to shutdown the tomcat server, then delete the project folder and war file and then again start the tomcat server.
But if I run the above code, server is getting shutdown, then only war file is getting deleted (not the projectWar folder) and nothing else. Please help me.
Upvotes: 2
Views: 2895
Reputation: 669
taskkill /f /t /im java.exe
timeout /t 30
pushd "tomcatHome\bin\"
call startup.bat
/f = force-quit
/t = stops the task and any subtasks
/im = image name of the process
Upvotes: 1
Reputation: 2251
When you call the shutdown command, the next commands don't wait for the server to shut down. The folder doesn't get deleted because it is still being used by the server (which is in the process of shutting down but not actually shutting down). So when it's done, the server is shutdown and the war is deleted (because nothing is using the war), but the folder is still there because when the delete command was called it was in use.
Upvotes: 0