batch file if help

March 15, 2009 at 18:52:43
Specs: Windows XP
i have a batch file that opens a programs 1, 2, and 3. i want it to close 1 and 2 when i close 3. im assuming it would use the IF command, but i cant figure out how to word it.

See More: batch file if help

Report •


#1
March 16, 2009 at 01:48:36
start 1.exe
start 2.exe
start /wait 3.exe
taskkill /im 1.exe
taskkill /im 2.exe

Hope you have taskkill in xp :-(

--
Holla.


Report •

#2
March 16, 2009 at 13:56:09
it worked, but it just so happens that 1.exe happens to be a cmd window. when i say taskkill /im cmd.exe it closes my current batch window and not both. 1.exe has the extension .cmd but it still shows up in a cmd window and as cmd.exe in the task manager. any way to distinguish the two?

Report •

#3
March 17, 2009 at 10:56:38
tiger,
type "taskkill/?" and read the help.
there is an option to apply filter /fi windowtitle eq *unique*

hope it works.

--
Holla.


Report •

Related Solutions


Ask Question