DIGIT-ARC read-only archive · snapshot: July 23, 2026

Close program when batch file closes.

7 posts · originally from https://geek.digit.in/community/threads/close-program-when-batch-file-closes.156771/

D@rekills4
D@rekills4 Original post #1
May 10, 2012 at 8:07 AM
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
RCuber #2
May 10, 2012 at 9:06 AM
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..
Champ
Champ #3
May 10, 2012 at 10:53 AM
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
D@rekills4
May 10, 2012 at 9:06 PM
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?
RBX
RBX #5
May 11, 2012 at 6:04 AM
That's the default behavior.
RCuber
RCuber #7
May 11, 2012 at 11:19 AM
did you try my tip?