Fix “[SC] DeleteService FAILED 1072: The specified service has been marked for deletion.” without rebooting

Just another (un)usual day as a sysadmin. Today a colleague asked me to reboot a server, because he couldn’t get a service deleted from services.msc
Well, a reboot because of a service deletion sounds pretty exorbitant to me, so I tried to delete the service myself, but then faced the same error:

sc.exe \\itexperience-server01 delete "nsclientpp"
[SC] DeleteService FAILED 1072:
The specified service has been marked for deletion.

I then tried to use WMI to delete the service, but still no effect (powershell):

$service = Get-WmiObject -Class Win32_Service -Filter "Name='nsclientpp'"
$service.delete()
__GENUS          : 2
__CLASS          : __PARAMETERS
__SUPERCLASS     :
__DYNASTY        : __PARAMETERS
__RELPATH        :
__PROPERTY_COUNT : 1
__DERIVATION     : {}
__SERVER         :
__NAMESPACE      :
__PATH           :
ReturnValue      : 0

Solution for [SC] DeleteService FAILED 1072

Make sure all of your mmc.exe processes are stopped. Apparently, in my case, two other users were logged on to the server, running some MMC consoles. As soon as I killed all mmc.exe processes, the deletion was successful:

sc.exe \\itexperience-server01 delete "nsclientpp"
[SC] OpenService FAILED 1060:
The specified service does not exist as an installed service.

Cheers. I hope this helped.

0 0 vote
Article Rating
Subscribe
Notify of
guest
2 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
meme

lol, helped. TY!

Tobias

Yup, helped! Thanks a lot!

2
0
Would love your thoughts, please comment.x
()
x