Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Batch Files

Options
  • 16-05-2007 9:21am
    #1
    Registered Users Posts: 1,552 ✭✭✭


    How do you use a batch file to close down a running program?
    eg. If I wanted it to close tomcat and apache if they're running how could I do that?


Comments

  • Registered Users Posts: 7,468 ✭✭✭Evil Phil


    Is this for Windows? If so all you need is a tutorial on Windows batch files and then the console commands for apache.

    Windows Batch Files

    Console Commands for Apache


  • Registered Users Posts: 169 ✭✭DonnieBrasco


    try

    TASKKILL

    its not a graceful termination to a program but it will take care of business


  • Registered Users Posts: 21,264 ✭✭✭✭Hobbes


    quinnd6 wrote:
    How do you use a batch file to close down a running program?
    eg. If I wanted it to close tomcat and apache if they're running how could I do that?

    If tomcat was running as a service it would be something like.

    net stop "the service name"

    You can get the name of the service by right clicking My Computer, select manage and then go to services.


  • Registered Users Posts: 378 ✭✭sicruise


    Put at the start of the batch file

    set PATH=APACHE_HOME\bin;TOMCAT_HOME\bin;%PATH%

    replace APACHE_HOME & TOMCAT_HOME with their locations so for example your batch file would look something like this
    set PATH=c:\apache2\bin;c:\tomcat5\bin;%PATH%
    
    :: Stop Apache
    apachectl stop
    :: Stop Tomcat
    shutdown
    


Advertisement