hi Levi,
This hasn't been answered, and I think I know why.
It's easy to kill a process, but difficult to get it going again.
You might consider the wshHeavenlyFather.Resurrect method... OUCH! I just
got zapped by a lightening bolt! Better behave myself, and stifle the
sacrilege...
If you are courageous enough (or foolhardy enough) to use a third-party
control (to call an api), then you might tale a look at the "SuspendThread"
/ "ResumeThread" api's.
There is also a "SetBlockingHook" function that will (allegedly) suspend /
resume a thread.
"Dirty Tricks" Dept: If you know that the app will be needing access to some
system resource (like a file, perhaps), then you could lock the resource.
That would hold up the app for you. And, when you release the resource
(hopefully) the app will take off again.
Or, barring that, maybe some more knowledgable person will come along and
post a wmi method for doing the suspend / resume thread functions via 'pure"
script...
(You can suspend your own process by using a sleep api call, or
WScript.Sleep).
cheers, jw
Quote:
> Hi,
> Can anyone tell me how to stop a process via script (as an alternative to
> doing it from the Task Manager) and then restarting it.
> TIA
> Levi