@echo onIn the above code, %~1 is for passing a runtime variable whose value has spaces. In my case 1 contained the installation directory path, with spaces - "C:\Program Files\"
"%~1\Apache Software Foundation\bin\tomcat6" //IS//Tomcat6 --Startup auto --JvmMx 516 --JvmMs 256 --Install "%~1\Apache Software Foundation\bin\tomcat6.exe" --Jvm auto --StartMode jvm --StopMode jvm --StartClass org.apache.catalina.startup.Bootstrap --StartParams start --StopClass org.apache.catalina.startup.Bootstrap --StopParams stop --StartPath "%~1\Apache Software Foundation" --StopPath "%~1\Apache Software Foundation" --Classpath "%~1\Apache Software Foundation\bin\bootstrap.jar"
if not errorlevel 0 goto unInstall else goto end
:unInstall
echo uninstalling.......
"%~1\Apache Software Foundation\bin\tomcat6" //DS//Tomcat6
"%~1\Apache Software Foundation\bin\tomcat6" //IS//Tomcat6 --Startup auto --JvmMx 516 --JvmMs 256 --Install "%~1\Apache Software Foundation\bin\tomcat6.exe" --Jvm auto --StartMode jvm --StopMode jvm --StartClass org.apache.catalina.startup.Bootstrap --StartParams start --StopClass org.apache.catalina.startup.Bootstrap --StopParams stop --StartPath "%~1\Apache Software Foundation" --StopPath "%~1\Apache Software Foundation" --Classpath "%~1\Apache Software Foundation\bin\bootstrap.jar"
:end
echo exiting....
Save the code as a .bat file and execute it. Make sure that you have already installed tomcat in the location as mentioned in the code. In my case, Tomcat was installed under "C:\Program Files\".
0 comments:
Post a Comment