closing programs in dos
-
Re: closing programs in dos
Hey all,
Found this thread via google, and since it helped sort out my problem (which wasn't anywhere near related to excel macro's!)...thought i'd add my 2 cents in case someone else runs into something similar.
Problem:
"start" command was needed because a process fired by a Subversion server hook event (post-commit) was waiting for the process to be completed before letting the client know all was well...The post-commit hook was sending emails so this was taking a while (too long)....The start command fixes this delay problem...but as mentioned, also leaves an empty dos shell on the server. Ugly and a resource waste (and eventually you would run out of resources).
Solution:
Run "start" with the /b parameter
This means your program stays within the current shell, that way it's far (far!) easier to grab the PID - because it's the current process - and then kill it.
If you want to see the code (it's open source), slurf to:
batch file example
and
custom NAnt task at the bottom - search for "killprocess"
peace
si
-
Further testing revealed that you don't even need to kill the process (so long as it terminates)...so even cleaner!