Computing.Net > Forums > Programming > batch file if help

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

batch file if help

Reply to Message Icon

Name: bsltiger
Date: March 15, 2009 at 18:52:43 Pacific
OS: Windows XP
Subcategory: Batch
Comment:

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.



Sponsored Link
Ads by Google

Response Number 1
Name: Holla
Date: March 16, 2009 at 01:48:36 Pacific
Reply:

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.


0

Response Number 2
Name: bsltiger
Date: March 16, 2009 at 13:56:09 Pacific
Reply:

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?


0

Response Number 3
Name: Holla
Date: March 17, 2009 at 10:56:38 Pacific
Reply:

tiger,
type "taskkill/?" and read the help.
there is an option to apply filter /fi windowtitle eq *unique*

hope it works.

--
Holla.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: batch file if help

Simple Batch File command help www.computing.net/answers/programming/simple-batch-file-command-help/16568.html

Batch file , need help urgently www.computing.net/answers/programming/batch-file-need-help-urgently/16211.html

Batch File Challenge! Help! www.computing.net/answers/programming/batch-file-challenge-help/10349.html