Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SC Delete Not Deleting Service

So I'm running Windows Server 2008 R2 Standard and am trying to delete a service with 'sc delete <myservicesname>' and the command seems to execute without complaint, however, when I check the services list after running the command, the service is still there.

Any ideas?

like image 429
Drew Avatar asked Sep 26 '13 20:09

Drew


3 Answers

sc in PowerShell is Set-Content; so if you are running in PowerShell, you likely have a file called 'delete' with your service's name as its content

If this is indeed your issue, use

sc.exe delete servicename
like image 105
Brian Witt Avatar answered Oct 09 '22 07:10

Brian Witt


Service can be marked for deletion, but may not be deleted immediately, since something holds it. See this answer for possible holders: https://stackoverflow.com/a/20565337/1943849

In my case, I just closed the Computer Management window

like image 20
astef Avatar answered Oct 09 '22 08:10

astef


Make sure to stop the service first then run the sc delete command. It will take care of closing any running process.

like image 1
TNV Avatar answered Oct 09 '22 06:10

TNV