Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to delete some records which in My computer -> Services

Status
Not open for further replies.

newcome

Programmer
Apr 14, 2005
5
HK
Hi,

I want to delete some damaged records on Services screen of My computer properties. how to do it ?
 
here's a vbs script to remove unwanted services:

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colListOfServices = objWMIService.ExecQuery _
("SELECT * FROM Win32_Service WHERE Name = 'Sr_Service'")
For Each objService in colListOfServices
objService.StopService()
objService.Delete()
Next


greetz

R.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top