The specified service has been marked for deletion
Before upgrading or uninstalling a program, it’s generally a good idea to stop it’s services before doing so.
So i did that using services.msc, and run the uninstaller. However, the installer said that he was unable to remove the service, and a reboot was required. I didn’t really feel like rebooting, i had a look at the registry. The service was still there, and it was still visible in services.msc, but i was unable to start it – the error message said “The specified service has been marked for deletion”.
I tried “sc delete name“, but i got the same error message: “The specified service has been marked for deletion”.
After that, i closed the services.msc window. Now, the service was no longer installed, and after restarting services.msc, it was no longer visible. I ran the installer again, with services.msc closed – it was now able to finish installing the application and it’s associated services.
So what did i learn?
Always close services.msc when installing or upgrading programs!

Drac:
Thanks for this… you were one of the top matches in google!
13. June, 2007, 16:13Liam:
Agree with Drac – one of the top, and it resolved my issue, thanks!
19. June, 2007, 03:26Venu:
Excellent tip, this addressed my problem. Thanks a lot.
26. June, 2007, 18:09nick:
had a similar problem, and found that logging off and back on did something to fix it.
3. July, 2007, 01:08Richard:
Good tip. Interestingly, I found that in Windows XP I did not need to close services.msc when reinstalling a service. But on Windows 2000 server I did. So the behaviour is not consistent between different versions of Windows.
24. July, 2007, 10:56Rob:
I had a disabled service that was marked for deletion. I didn’t want to reboot, shutting down services.msc allowed SCM to continue with the removal, result! Thanks.
30. August, 2007, 11:17Tobias:
Thanx a lot! I wouldn’t have tried it without your tip :)
11. September, 2007, 11:26Jim:
Easy fix. Thanks! (Why doesn’t Microsoft publish this type of information?)
13. September, 2007, 21:12Jim #2:
Thanks a million for this. You just saved me a huge headache and a lot of time :)
26. September, 2007, 02:19Jayce:
Every once in a while, simply closing .msc doesn’t work for me, and I’m forced to reboot XP in order to get the error to go away, like it says here: http://support.microsoft.com/kb/823942.
Does anyone know what the underlying issue is? I read something somewhere about a registry entry that can’t be written to – which one?
2. October, 2007, 00:20peter adriaenssens:
Thanks a lot. very strange
22. October, 2007, 15:08Simon Gadsby:
Nice find.
1. November, 2007, 04:30Deepthi:
I guess I figured out the underlying issue.
14. December, 2007, 00:51The issue occurs when the service is attempted to delete and the instance(s) of the service is still running or is locked by any other programs.
I used process explorer to figure out the proccesses that had lock on the service instance that has been marked for deletion. Once they are killed, I logged off and logged back in just to find that the issue is resolved! :)
Julian Dixon:
Had this issue time and time again. Always just rebooted. Now on a production server so needed to clear this without reboot. Use sc.exe to delete service. If it hangs/marked for deletion, check the task manager for any exe’s relating to that services and [End process] them. Finally go to registry, look in HKLM\SYSTEM\CurrentControlSet\Services for the entry relating to the service remove that. AND then the clever part which stumped me until reading your tip was close the services.msc, until I did this it was still marked for deletion. Thanks!
15. January, 2008, 14:36Etienne:
Lol. Thanks for the tip. And thanks for Google.
30. January, 2008, 15:05Dan:
Thank you so much! This has been a life-saver!
19. February, 2008, 20:51AC:
Thank you! Almost did a reboot on msdn article and thought what the heck, I will keep looking.
11. March, 2008, 02:48Bembeng Arifin:
Thanks so much, this KB (http://support.microsoft.com/kb/823942) indeed does not apply for my windows 2000 PC, after i closed the computer management screen, i can register and unregister many times without problems ;)
11. March, 2008, 09:57lecedre:
Hi,
I have seen that it occurs if you try to uninstall a service which is selected when you remove it. Try to unselect the service prior uninstalling.
22. April, 2008, 11:35Scott:
Thanks for posting this. I didn’t want to restart either!
26. April, 2008, 04:10bogdan:
hahahahahahha! one of the best tips ever
5. June, 2008, 15:06i banged my head to the desk for two days now. almost rewritten an entire reinstall procedure with starting/stopping/sc-deleting my service, etc
AWESOME!
gkokmdam:
Just the thing to same me time. Thanks. Just marvelous!
9. June, 2008, 15:57MrRobot:
Thanks, this must be included in an MS kb article! This time it was not easy to just restart, as I’m on a debug session and there are tons of stuff running..
24. June, 2008, 07:46Dave:
Amazing how simple things are to fix sometimes, but yet we continue to make it harder than it is.
Thanks so much for saving my day.
24. June, 2008, 23:22William:
Thanks for the quick fix. LOL I had my services.msc open as well
25. June, 2008, 18:59Alex B:
Nice, thank you.
2. July, 2008, 16:47Mark Troffaes:
Thanks for posting this.
30. September, 2008, 10:28Jonathan:
Thanks for the tip! (pretty obvious if you think it afterwards;))
1. October, 2008, 15:06Yaniv:
Excellent tip
helped me too
6. October, 2008, 13:18Ritchie Rich:
Wonderful explanation about services. However Does the same apply for Kernel Services too?? Has anybuddy come across to get the Kernal Service installed/Uninstalled with out rebooting the computer??
Alternatively, I am not using “Services.msc” to stop / delete services, I’m doing so on command prompt. But still the kernal service doesn’t get stopped or deleted. I Also observed that there is “Services.exe” running in taskbar which couldn’t be killed (End Task) as it is running in System Context.
Is there any way around to deal with Kernal Services ??
21. October, 2008, 16:46Victor:
As an amature at this, I asked everyone that knew something for answers as well as Microsoft. My problem was the fax services, and finally out of desparation I unticked all the blocks on XP windows components, got the result required, and put each back cautiously one by one. Apparently my problem started after a virus attack.
25. November, 2008, 09:00Your insight helped me to get this right – Thanx a million
Prasanna:
Worked for me too .. i just closed all SERVICES and tried again , and it worked
12. December, 2008, 20:44George Loughton:
Lukas,
22. December, 2008, 16:10Your post has solved my problem, thank you. Generally I don’t need to do this when reinstalling the service, but this time I screwed the password up and Services went into the self-defence mode.
George
Igor:
You just saved me a lot of time…
17. January, 2009, 00:51Srikrishna:
Thanks a lot….Really,Superb tip …Thankyou
9. February, 2009, 12:25Paul Smith:
Bump!
Great post. I’d installed & uninstalled the same service a couple dozen times with no issues — stopping it in services.msc, then running installutil & deleting, then refreshing the mmc — and just one of those times it decided to hit me with that “marked for deletion” message. Now I’ll know to close & relaunch the mmc as a *first* resort, instead of diving into HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ to delete the key (as you probably know, that doesn’t work if the MMC is hanging on to an orphaned instance of the service entry).
Thanks!
4. March, 2009, 07:53Brendan:
Thanks! This just saved me some trouble. Lukas Beeler for president.
17. March, 2009, 13:17Shanthi:
Thanks a lot for the info.. Before I found this site, I used to restart my machine every time… Now I escaped from a big problem.
24. April, 2009, 14:01Thanks again..
GroverBot:
THANKS! I always rebooted, didnt realize it was a stupid windows that needed to be closed.
28. April, 2009, 02:34Deepak:
Thanks a lot…
13. May, 2009, 13:08it save lots of time as everytime i dont need to reboot the server..
Uma:
Hi, Thx a lot for giving such a useful tip :)
18. May, 2009, 07:45aecsant:
well said Deepthi,
i was stuck too, but when i killed the process associated with the service, and restarted service.msc, it gone.
saved lot of time.
Thanks OP
19. June, 2009, 10:31Dhilish:
Fantastic. It saved time
12. August, 2009, 13:37Carlos:
Thanks a lot man!!!
This was very useful for me!
14. August, 2009, 17:47Eric:
Thanks – very helpful… This “feature” still exists in Win7 x64!
27. August, 2009, 23:15Musafir_86:
-Thanks a lot! Even though my problem is different, I learnt the “SC” command from you!
-BTW, my problem is WinPhlash crashed during updating Acer Aspire 4520 BIOS. Retrying brought up a message saying NTPHLASH.SYS marked for deletion (error 1072).
-So, I run the WinPhlash program on another laptop, import (and edit accordingly) the HKLM\System\CurrentControlSet\Services\Winphlash and HKLM\System\CurrentControlSet\Enum\Root\Legacy_Winphlash keys (NOTE: permission need to be set in Regedit first). The I used “SC STOP WINPHLASH” to stop the currently loaded/running NTPHLASH.SYS. Then, I retry to flash the BIOS again and succeeded! Alhamdulillah. :)
Regards,
5. September, 2009, 11:37-Musafir_86.
George Vangelis:
Thanks for the help.
I had the same problem with Musafir_86.
I tried to Winphlash my Acer Aspire One AO751h with the latest bios and it always came up with an error message that I am not an Administrator…
I then used “SC STOP WINPHLASH” without any other modifications and it worked like a charm!
Regards,
25. September, 2009, 13:25George
Shullz Mkwelo:
Amazing…. Thanks, so simple and its all I needed after 2 hours of googling
12. October, 2009, 15:11jorge:
Excellent! I wonder if i should close MSC.exe as part of my uninstall :)
23. October, 2009, 00:37Nikolodeon:
Excellent! clear and simple, thanks a lot
26. October, 2009, 11:03Kshitij:
Amazing that even after 2 years, this post saved my hours at mid night. I was strugling to figure out how to get those services out, while installation was on. Thanks a ton!
10. November, 2009, 17:59Ana:
This helped me also :). I would have never thought that this is the problem. Thank you.
20. November, 2009, 15:50DikShuttle:
I had the error with only the networks window open. Closed the window… error went with it. Yaaay.
(I was un- & re-installing File & Printer Sharing in XP2SP2)
24. November, 2009, 18:32Gareth:
Thanks I would not have figured out such a stupid problem my self. :-)
1. December, 2009, 04:37josepherdon:
thanks.
a great help.
I thought there was something I am missing in my .NET Windows Service project.
Kudos!
23. December, 2009, 03:22LatinSuD:
From this behaviour it looks like services.msc is holding a kind of lock on services.
23. December, 2009, 14:44This contrasts with the fact that you have to press F5 to update the service list when it changes.
Weird.
khushboo Patel:
Thanks. You have solved my critical problem….
21. January, 2010, 07:15