Solved

Closing Program Automatically

Posted on 2008-06-18
5
512 Views
Last Modified: 2008-07-03
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.
0
Comment
Question by:fairgame
  • 2
5 Comments
 
LVL 17

Expert Comment

by:ExcelGuide
ID: 21810802
you might use VBS to do that....are you known with Visual Basic Scripting?
0
 
LVL 11

Expert Comment

by:EricTViking
ID: 21811059
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
 
LVL 1

Author Comment

by:fairgame
ID: 21864110
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
 
LVL 1

Accepted Solution

by:
fairgame earned 0 total points
ID: 21864186
Small correction

tasklist | find /i "ProgA" || "ProgB"
tasklist | find /i "ProgA" && taskkill /f /im ProgB & EXIT
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever notice how you can't use a new drive in Windows without having Windows assigning a Disk Signature?  Ever have a signature collision problem (especially with Virtual Machines?)  This article is intended to help you understand what's going on and…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question