Closing Program Automatically

Hi,

How can we close a program automatically when another different program starts?

For example: I've two programs, ProgA and PorgB

Whenever I start ProgA I want to close the ProgB automatically,
and after closing ProgA I want to start ProgB again automatically.
In simple words My ProgB should be running always, but not when ProgA runs.

I know a program which can close a Program Automatically Check this : http://ask-leo.com/d-nircmd
Now, how can I achieve using this or some other method.
LVL 1
fairgameAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
fairgameConnect With a Mentor Author Commented:
Small correction

tasklist | find /i "ProgA" || "ProgB"
tasklist | find /i "ProgA" && taskkill /f /im ProgB & EXIT
0
 
ExcelGuideConsultantCommented:
you might use VBS to do that....are you known with Visual Basic Scripting?
0
 
EricTVikingCommented:
Not sure that NIRCMD would do what you want as you will need to trigger it when ProgA closes - could be difficult?

If you can secure the services of a Windows programmer it would be simple for them to write a small app (windows service preferably) that when you run it would close ProgB and launch ProgA, it would then sit in the background monitoring ProgB - when ProgB clsoes the app would launch ProgA.

This type of program wouldn't take a decent coder more than 2-3 hours to write.

If you don't know a programmer you could try Rent-a-coder  http://www.rentacoder.com  where you could secure someones services for a competitive fee.
0
 
fairgameAuthor Commented:
My Solution
I am using Z-cron to run this Batch file for every 5 Minutes.

If ProgA is running it will kill ProgB else it will start ProgB
tasklist | find /i "ProgA" || "ProgB"
tasklist | find /i "ProgB" && taskkill /f /im ProgB & EXIT

Open in new window

0
All Courses

From novice to tech pro — start learning today.