how to stop a process 
Author Message
 how to stop a process

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



Mon, 14 Jul 2003 11:48:28 GMT  
 how to stop a process
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



Sat, 19 Jul 2003 05:10:15 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Stop processing of ASP-script

2. Stop processing

3. Stopping another process and minimizing/maximizing/restoring

4. Stopping a Service or Killing a Process with VBScript and WMI in ASP

5. Stopping a running process

6. Start and Stop processes

7. Stop, Stop, Stop..... Please HELP (code included)

8. Stop, Stopped ...

9. Browser Stop Button: when does ASP script stop?

10. Weirdness with debugging - STOP not stopping script

11. Killing a process and all its children processes....

12. Obtaining process id of newly created process

 

 
Powered by phpBB® Forum Software