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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Batch Files

  • 16-05-2007 8:21am
    #1
    Registered Users, Registered Users 2 Posts: 1,559 ✭✭✭


    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, Registered Users 2 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, Registered Users 2 Posts: 169 ✭✭DonnieBrasco


    try

    TASKKILL

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


  • Registered Users, Registered Users 2 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, Registered Users 2 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