Stopping Processes - Permission Errors

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I need to stop a set of processes periodically. The snippet of code that I'm
using to try and kill the processes is:

Set objWMIService = GetObject("winmgmts:" &
"{impersonationLevel=impersonate}!\\" & cComputer & "\root\cimv2")
Set colProcessList = objWMIService.ExecQuery ("Select * from Win32_Process
Where Name = '" & strProcessName & "'")
For Each objProcess in colProcessList
RetVal = objProcess.Terminate()

I am an administrator on the server. When I try to run the script, it will
kill some of the desired processes, but others I get permission denied. I
can go into Task Manager and kill the processes with no problem.

Any ideas on what I'm doing wrong?
Thanks,
Marty
.



Relevant Pages

  • Re: Symantec LiveState Agent for Windows vulnerability - Local Privilege Escalation
    ... Wouldn't you have to be administrator to kill shstart.exe? ... LocalSystem account has more privilegies then administrator's one. ... As an administrator you can gain SYSTEM privileges at any time. ...
    (Bugtraq)
  • Re: Facebook Hate Group
    ... administrator this can be reported to? ... Incitement to kill must surely be a criminal offence these days? ...
    (uk.rec.cycling)
  • Re: undestroyable process
    ... They might be 'critical' but as an administrator I can stop them / kill ... But even though the admin can't use TaskManager any longer, ... It is *impossible* to prevent the Adminstrator from killing any ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Hide Process From Nt/Xp - Does this work?
    ... > a netcafe computer to meter internet usage? ... > you can run the application as administrator ... Not even administrators can kill service processes. ...
    (comp.lang.pascal.delphi.misc)
  • Find and kill user process.
    ... Let us suppose that one of users of a database run some process. ... administrator see and kill this process? ... Prev by Date: ...
    (comp.databases)