Sponsored Links

Login Form






Lost Password?

Syndicate

Home arrow RSS Feeds
Remove a Service PDF Print E-mail
User Rating: / 0
PoorBest 
Written by Cheyenne Harden   
I had to remove an application from a server the other day. After the uninstall the application left some of the services behind.
The script below will remove the service from the services.msc console.

----------COPY EVERYTHING BELOW THIS LINE----------


'This script is used to remove a service from Services.msc
'Cheyenne Harden 12.18.06

strComputer = "."
strService = inputbox("Type in the service to be removed.")
If strService > "" Then
strService2 = "'" & strService & "'"

Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colListOfServices = objWMIService.ExecQuery _
    ("Select * from Win32_Service Where Name = "& strService2 & " ")

For Each objService in colListOfServices
    'objService.StopService()   ' used for testing
    objService.Delete()
Next

Else
Wscript.Echo "You did not type in a service name."
Wscript.Quit

End If

Wscript.Echo strService & "Removed"


----------COPY EVERYTHING ABOVE THIS LINE----------

 

 

PLEASE MAKE SURE NO WORD WRAPPING IS HAPPENING IN YOUR SCRIPT!!!

To make this script work you will need one things!


1. You will need to have Admin privlidges on the computer.


This information is provided "AS IS" with no warranties expressed or implied.

Comments
Add New
Write comment
Name:
Email:
 
Title:
 
:angry::0:confused::cheer:B):evil::silly::dry::lol::kiss::D:pinch:
:(:shock::X:side::):P:unsure::woohoo::huh::whistle:;):s
:!::?::idea::arrow:
 
Please input the anti-spam code that you can read in the image.

3.26 Copyright (C) 2008 Compojoom.com / Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved."

 
Tag it:
Delicious
Furl it!
Spurl
digg
YahooMyWeb
< Prev   Next >
 

Google Search

Google