Home All Groups Group Topic Archive Search About

determining when shell command finishes

Author
1 Feb 2006 12:58 AM
greg gallager
Hello all,

I've got to believe this has been asked and answered before, I've been
browsing for about an hour.....

All I need to do is be aware when an external (DOS) program has finished. 
The shell command returns a 'task id', is there a simple way (API call?) to
determine if the given task id is still present and loop (perhaps delay a few
ms) until it's done?

Perhaps a getprocess..... call?

I'm sure this is an easy one...shellandwait seems like overkill for what I
want.

--
greg gallager
gallid assoc inc

Author
1 Feb 2006 2:05 AM
Karl E. Peterson
greg gallager wrote:
> I've got to believe this has been asked and answered before, I've been
> browsing for about an hour.....
>
> All I need to do is be aware when an external (DOS) program has
> finished. The shell command returns a 'task id', is there a simple
> way (API call?) to determine if the given task id is still present
> and loop (perhaps delay a few ms) until it's done?
>
> Perhaps a getprocess..... call?
>
> I'm sure this is an easy one...shellandwait seems like overkill for
> what I want.

Huh?  Shellandwait is the classic search term for this need.  Yes, it's been
asked and answered a many, many thousands of times.  Here's a handful of
possibilities: http://vb.mvps.org/samples/Shell32
--
Working without a .NET?
http://classicvb.org/