Close program when batch file closes.

D@rekills4

In the zone
I am opening a program using a batch file....
Once its opened, the Command Prompt window of the batch file keeps open....

What I want is that when I close the Command Prompt window of the batch file, the program which opened with the batch file should close too....

Can I do that?
 

RCuber

The Mighty Unkel!!!
Staff member
use the following at the end of your batch file
Code:
taskkill /F /IM progname.exe /T
exit

progname.exe = your program to be terminated..
 
Last edited:

Champ

.NET Guru
I am opening a program using a batch file....
Once its opened, the Command Prompt window of the batch file keeps open....

What I want is that when I close the Command Prompt window of the batch file, the program which opened with the batch file should close too....

Can I do that?
Please rephrase the question

1. You want batch file to close after launching ur program
or
2. Program to close itself as soon as you close batch file
 
OP
D@rekills4

D@rekills4

In the zone
Please rephrase the question

1. You want batch file to close after launching ur program
or
2. Program to close itself as soon as you close batch file




Program to close itself as soon as you close batch file.
This what I want...
Any idea if I can it?
 
Top Bottom