martman2002uk
asked on
Killing SYSTEM Processes Using A VBS File
Hello
im trying to make a VBS file that will end a list of process, so far using the web i have made a VBS file, the first part of which is listed belowe
-------------------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- --------
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=imper sonate}!\\ " & strComputer & "\root\cimv2")
Set colProcessList = objWMIService.ExecQuery _
("Select * from Win32_Process Where Name = 'ati2evxx.exe'")
For Each objProcess in colProcessList
objProcess.Terminate()
Next
Set colProcessList = objWMIService.ExecQuery _
("Select * from Win32_Process Where Name = 'LVPrcSrv.exe'")
For Each objProcess in colProcessList
objProcess.Terminate()
Next
-------------------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- --------
i have all the processes i want to end in this file, but it seems as if the VBS file doesnt end any process that are not running under my username
is there a way i can make the VBS file end all the processes in the VBS file no matter who is running it
any hepl is a plus, thanks.
im trying to make a VBS file that will end a list of process, so far using the web i have made a VBS file, the first part of which is listed belowe
--------------------------
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=imper
Set colProcessList = objWMIService.ExecQuery _
("Select * from Win32_Process Where Name = 'ati2evxx.exe'")
For Each objProcess in colProcessList
objProcess.Terminate()
Next
Set colProcessList = objWMIService.ExecQuery _
("Select * from Win32_Process Where Name = 'LVPrcSrv.exe'")
For Each objProcess in colProcessList
objProcess.Terminate()
Next
--------------------------
i have all the processes i want to end in this file, but it seems as if the VBS file doesnt end any process that are not running under my username
is there a way i can make the VBS file end all the processes in the VBS file no matter who is running it
any hepl is a plus, thanks.
If you are not administrator, you can't terminate process run by other users regardless of what method you use. Also some processes e.g. service can't be terminated this way.
ASKER
i am on the computer as adminstrator and from what i gather...
impersonationLevel=imperso nate
means the VBS file will run as if it was me, but i can end SYSTEM processes, how come the VBS file wont ? and is there a way to end services with a VBS script that i can add to the end of this VBS file
impersonationLevel=imperso
means the VBS file will run as if it was me, but i can end SYSTEM processes, how come the VBS file wont ? and is there a way to end services with a VBS script that i can add to the end of this VBS file
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
wouldn't this be done easier just using a batch file?
taskkill.exe /im ati2evxx.exe
just a thought
taskkill.exe /im ati2evxx.exe
just a thought
ASKER
Well it depends on which one gets the job done, so far some of the batch files i have made and used do not work.
on closer look of the processes i have running and want to end, i've come to the conclusion that they are services, is there a VB way to end/stop a service? without stopping it from running at next boot up?
on closer look of the processes i have running and want to end, i've come to the conclusion that they are services, is there a VB way to end/stop a service? without stopping it from running at next boot up?
net stop <service>
use a batch,.. there is no reason not to,.
if you want to do it at a specific time, use task scheduler
use a batch,.. there is no reason not to,.
if you want to do it at a specific time, use task scheduler
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
@amit g
is there a way to stop the service by filename, such as ati2evxx.exe ?
is there a way to stop the service by filename, such as ati2evxx.exe ?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
oops,. forgot to dim colListOfServices2
Change
("Select * from Win32_Service where Caption = 'Symantec AntiVirus'")
to
("Select * from Win32_Service where PathName = 'C:\\WINNT\\system32\\Ati2 evxx.exe'" )
You will have to give full path with \ escaped.
("Select * from Win32_Service where Caption = 'Symantec AntiVirus'")
to
("Select * from Win32_Service where PathName = 'C:\\WINNT\\system32\\Ati2
You will have to give full path with \ escaped.