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 two exe file I need run at the same time, and when the first get closed close the other one.

start programA.exe
start programB.exe

onclose(programA.exe)
taskkill /im programB.exe

Not working. Just for easier understanding.

share|improve this question
add comment

migrated from stackoverflow.com Jun 5 '13 at 8:42

This question came from our site for professional and enthusiast programmers.

1 Answer

up vote 0 down vote accepted
start notepad.exe
start /wait calc.exe
echo wait until calc.exe is finished
echo then kill notepad.exe
taskkill notepad.exe

Attention: if more than one instance of (in this example) Notepad is running, this may close the wrong one.

share|improve this answer
    
Thanks a lot, this is what I needed –  Akxe Jun 5 '13 at 21:36
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.