ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Post New Requests Here

IDEA:Check for program exit and offer to close other programs

(1/6) > >>

paarkhi:
I am looking for a utility (ahk script is fine) which sits in the background and waits until a certain program is started, and then exited (checking every second or two).  when the program exists after running, it should check for a list of programs i specify that might also still be left running, and offer to close them.

As an example:
When i run and then exit firefox, i want the utility to check if my standalone downloader application is still running, and if so, offer to close it.

skwire:
I don't think this is enough for a full-fledged application.  I'll write you an AHK script that you can adjust and modify accordingly.  What you're asking for is rather simple to do.

MilesAhead:
(Before you replied skwire I did a small rudimentary app in AutoIt3.)

The program is called RunGroup.  You can run more than one copy.  The idea is to put a copy of RunGroup.exe in a folder and run it.  The first time it will quit saying you must have an .ini file.  It will generate the .ini.  You just filll in the Master Program and up to 4 SubPrograms.  (Don't use double quotes even if there is a space in the path.)  

Here's an example .ini filled in:

[Settings]
MainProgram=C:\Windows\system32\notepad.exe
SubProgram1=C:\Program Files (x86)\FavesSoft\FavesSA.exe
SubProgram2=C:\Program Files (x86)\JGsoft\EditPadLite\EditPadLite.exe
SubProgram3=
SubProgram4=


How it works is, it launches all the subprograms, then launches Main Program and waits for it to finish.  After Main Program is closed, it checks if each SubProgram is running.  If so, it gives a MsgBox do you want to kill it?  If you click Yes, it's killed.  Very simple.  You can have a different folder with RunGroup.exe for each .ini file.

It's primitive, but as skwire says, it's a pretty elementary task.
I looked around some of the freeware sites and I didn't notice a launcher that's combined with a monitor like this.  Kind of surprises me.  There probably are some that I didn't happen to hit on.

RunGroup.zip just has the RunGroup.exe in it.  It's pretty simple so you shouldn't need more instructions than this post.


edit: oh, one other thing.  If you want to pass a command line onto the Main Program, run RunGroup.exe with a command line and it will be passed on.  In the example above if you did this command at a command prompt:
RunGroup  Readme.txt

then notepad would open with Readme.txt if it exists.
If you don't like command prompts you can make a shortcut with the command line as part of the Target line etc..

edit2: AutoIt3 scripts compiled to .exe can give false positives in anti-virus programs.  Must be something in the exe wrapper that matches a signature in some of them. You can run the program inside something like Sandboxie to see what it does if you don't trust it. :)

skwire:
Sweet.   :)  I'll wait to hear back from paarkhi to see if your app suits his needs before I start. 

MilesAhead:
Sweet.   :)  I'll wait to hear back from paarkhi to see if your app suits his needs before I start. 
-skwire (October 08, 2009, 12:53 AM)
--- End quote ---

 :Thmbsup:

Navigation

[0] Message Index

[#] Next page

Go to full version