Start and Stop processes 
Author Message
 Start and Stop processes

I need to stop some processes in W2K. I know how to stop and start Services
but not associated processes, actually most processes start when the service
starts but how does one stop them using WSH?
Thanks for the help or pointers.
Ralph H.


Mon, 08 Sep 2003 05:04:54 GMT  
 Start and Stop processes
Ralph Hulslander says:

Quote:
>I need to stop some processes in W2K. I know how to stop and start Services
>but not associated processes, actually most processes start when the service
>starts but how does one stop them using WSH?
>Thanks for the help or pointers.

Dim procs, proc, wql
wql = "SELECT * FROM Win32_Process"

Set procs = GetObject("winmgmts://").ExecQuery(wql)
For Each proc In procs
   If proc.Description = "processname" Then proc.Terminate
Next
Set procs = Nothing

just replace "processname" with the name of the process

----------
Randy Hunt
MCP+I / MCSE

visit www.wshscripting.com



Mon, 08 Sep 2003 07:44:32 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Stop processing of ASP-script

2. When will JScript stop using the Enumerator and start using for...in Statment for Collections

3. Stop processing

4. ASP form with Start and Stop dates

5. Starting, stopping and pauseing a service.

6. Please HELP (Net Stop / Net Start Spooler)

7. Problems with stopping/starting service

8. How to start/stop services with vbscript?

9. START/STOP/ displayed Services running on PC thu an ASP page

10. How to start/stop a NT service

11. start and stop services

12. stop/start a script

 

 
Powered by phpBB® Forum Software