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

DonationCoder.com Software > Finished Programs

DONE: Program to Start another program, and then shut down after xx:xx time.

(1/8) > >>

nkormanik:
Here is the idea:

Defaults held in an .ini file.  All set and ready to go.  Desktop shortcut.

New Program will start any program, PGM, user wants (program executable location held in .ini file).

After a certain amount of time (xx:xx, held in .ini file) the New Program will terminate PGM, and exit completely leaving zero memory footprint.

The chief purpose of this New Program is at the termination end -- stopping PGM after a certain amount of time.  If there is already an existing way to accomplish this, please let me know.

Anyone interested??

Thanks much.

Nicholas Kormanik


MilesAhead:
The trouble with a general-purpose program termination routine is knowing particulars of the program to be terminated.  For example, if the target program is an editor, how to make it save febore killing it. If it's writing to the drive, how to detect it and wait until it's done etc...

A pop-up reminder saying "Don't you want to terminate App xyz??" may be simpler.

nkormanik:
Good point, MilesAhead.  In this particular case let's assume no problem terminating.  Nothing to save.  No disk writes to complete.

Just kill it.  After xx:xx time.

Researching out there, others have asked for such a program, and apparently none exists.

x16wda:
With some restrictions this batch file should do it:

   start notepad.exe
   ping -n 61 127.0.0.1>nul
   pskill notepad.exe

This will fire up Notepad and then kill it a minute later.  The restrictions would be that you have to convert your desired run time to seconds (and add one), and in the end it kills all copies of the program.  In real use you'd use something like min.exe to minimize the cmd window (or something like chp.exe to hide it), you'd set the executable and time limit as parameters to pass, you could use one of several utilities to convert time to duration in seconds, and you might use one of Horst Schaeffer's utilities to let you choose the program to run, etc.  Tart it up real nice.  :D

A plain old batch file isn't as pretty as a nice exe, but if you don't need the efficiency of compiled code it can do fine.

x16wda:
You know, a tiny little command line program that would spit out either its own pid or its parent's pid would be real convenient for this (and for some other tasks I've needed to do)...

Navigation

[0] Message Index

[#] Next page

Go to full version