Skip to content

Instantly share code, notes, and snippets.

@mayrund
Created June 8, 2016 12:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mayrund/1d317fb64cc882e45a1f3eea493113da to your computer and use it in GitHub Desktop.
Save mayrund/1d317fb64cc882e45a1f3eea493113da to your computer and use it in GitHub Desktop.
Uninstall Windows Service VBScript
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colListOfServices = objWMIService.ExecQuery _
("Select * from Win32_Service Where Name = 'Name_Of_Service_You_Want_To_Uninstall_Here'")
For Each objService in colListOfServices
objService.StopService()
objService.Delete()
Next
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment