Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a .bat file to run some programs (Apache httpd, Tomcat, ecc.). These programs have their own window and if I just type this into the .bat file:

../apache/bin/httpd.exe
../tomcat/bin/catalina.exe
...

When this runs I get many prompt windows, how can I prevent this?

share|improve this question
add comment

2 Answers 2

up vote 2 down vote accepted

Add at the beginning of the batch file:

@echo off

The commands in the Batch file would actually be start

start /B ../apache/bin/httpd.exe

start /B ../tomcat/bin/catalina.exe

http://ss64.com/nt/start.html

/B : Start application without creating a new window. In this case ^C will be ignored - leaving ^Break as the only way to interrupt the application

share|improve this answer
    
Wow, I think you completely misunderstood the question, and obviously so did the upvoters. The way I see it each EXE is launching a new cmd window and that's what he wants to prevent. –  Karan May 17 '13 at 15:16
    
@Karan You're right. Fixed with the actual command. –  Kruug May 17 '13 at 15:20
    
It is quite perfect... Is it possibile to store in some way that process session to send a term signal? I would like to stop apache and tomcat if the main (and lonely) windonw will be closed. Thanks –  Tobia May 18 '13 at 12:43
    
@Tobia I have not used the start command myself, nor have I done much batch scripting. Sorry :( –  Kruug May 18 '13 at 14:08
add comment

Another way to solve this problem is to use CHP http://www.commandline.co.uk/chp/

This program run an hidden process and return its PID by return code. Than you can use this pid to close the process with taskkill.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.