Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7728071
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T05:37:29+00:00 2026-06-01T05:37:29+00:00

Is it possible to modify a certain batch file for Tomcat such that before

  • 0

Is it possible to modify a certain batch file for Tomcat such that before Tomcat which is set as a web service will start would do something like checking or modifying some files?

So what we want is everytime the Tomcat Service starts, do some modifying for some specific files which is needed by the application which is hosted by tomcat.

If its possible to do it by one of the batch files in tomcat then which batch file should we modify? Any ideas would be much appreciated. By the way, we’re using tomcat 7.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T05:37:30+00:00Added an answer on June 1, 2026 at 5:37 am

    Short answer: It is NOT possible, at least there is no easy way to do it, just as it was discussed on the page Shashank Kadne pointed out. Other than starting Tomcat via startup.bat script and placing you code (or a call to your BAT file) in the setenv.bat file in the same folder as startup.bat.


    If you are trying to run applications like Jenkins, Artifactory and alike on a single Tomcat installation – as discussed on that page – a better way would be to create a Tomcat Server Instance (also known as CATALINA_BASE) for each additional application.

    This way you can have each application as a Windows Service and control it as a service.

    Assumptions:

    • You Java is installed at C:\Program Files\Java\jdk-7.0_03.

    • You Tomcat is installed at C:\Program Files\Apache\Tomcat 7.

    • You want e.g. Jenkins server to be at C:\Program Files\My Jenkins.

    Start cmd.exe, and do the following:

        C:\Users\me> set "JAVA_HOME=C:\Program Files\Java\jdk-7.0_03"
        C:\Users\me> set "CATALINA_HOME=C:\Program Files\Apache\Tomcat 7"
        C:\Users\me> set "CATALINA_BASE=C:\Program Files\My Jenkins"
        C:\Users\me> cd "%CATALINA_BASE%"
        C:\Program Files\My Jenkins> mkdir "%CATALINA_BASE%\bin"
        C:\...Jenkins> mkdir "%CATALINA_BASE%\conf"
        C:\...Jenkins> mkdir "%CATALINA_BASE%\lib"
        C:\...Jenkins> mkdir "%CATALINA_BASE%\logs"
        C:\...Jenkins> mkdir "%CATALINA_BASE%\temp"
        C:\...Jenkins> mkdir "%CATALINA_BASE%\webapps"
        C:\...Jenkins> mkdir "%CATALINA_BASE%\work"
        C:\...Jenkins> copy "%CATALINA_HOME%\conf\*.*" "%CATALINA_BASE%\conf"
        C:\...Jenkins> copy "%CATALINA_HOME%\bin\*.exe" "%CATALINA_BASE%\bin"
        C:\...Jenkins> copy "%CATALINA_HOME%\bin\tomcat-juli.jar" "%CATALINA_BASE%\bin"
        C:\...Jenkins> cd bin
        C:\...Jenkins> ren tomcat7.exe jenkins.exe
        C:\...Jenkins> ren tomcat7w.exe jenkinsw.exe
    

    The next command should be in a single line

        C:\...Jenkins> jenkins.exe //IS//Jenkins --DisplayName "Jenkins CI"
          --Description "Jenkins Continuous Integration Server on Tomcat"
          --Startup auto --JavaHome "%JAVA_HOME%" --StartMode jvm --StopMode jvm
          --StartClass org.apache.catalina.startup.Bootstrap
          --StopClass org.apache.catalina.startup.Bootstrap
          --StartParams start --StopParams stop
          --Classpath "%CATALINA_HOME%\bin\bootstrap.jar;%CATALINA_BASE%\bin\tomcat-juli.jar;"
          --StdOutput auto --StdError auto --LogLevel INFO
          --LogPath "%CATALINA_BASE%\logs"
          --JvmOptions -Xrs;-Dcatalina.home=%CATALINA_HOME%;-Dcatalina.base=%CATALINA_BASE%;
    

    You should now have the Jenkins CI service in your “Services” window.

    Deploy the Jenkins web application (WAR file) into %CATALINA_BASE%\webapps.

    The steps I gave above are coming “from the the head” and are not tested, I might have missed a parameter or two. That is why there is the %CATALINA_BASE%\bin\jenkinsw.exe – start it and tweak the parameters until the server is working.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to set in .vimrc that vim saves the file every time
Is it possible to modify a TFS 2010 Process Template such that a field
On webpart-pages it is possible modify the contained webparts over the Web by using
Is it possible to modify/write data to an XML file without any server-side proxy(e.g.
Supposing I have a merge module that installs a file MyFile.txt to a certain
Is it possible to create a C# EXE or Windows Service that can process
Is it possible to modify the contents of an APK (add a file) after
Is it possible to modify the title of the message box the confirm() function
Is it possible to modify a registry value (whether string or DWORD) via a
Is it possible to modify/edit, already installed firefox addons? Where are the addons stored

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.