I recently got a question from a user about uninstalling a managed service. The service installed and ran fine. But after it was uninstalled using InstallUtil.exe /u, the service was still listed in the Services MMC console, just marked as disabled. Attempting to access the service produced the message “The specified service has been marked for deletion.” The service was not fully removed until the system was rebooted.
This scenario is most likely to happen on a Windows 2000 system, which may sometimes require that the system be rebooted between uninstall and reinstall of the same service.
First, realize that the service really has been uninstalled at this point; it’s just that it doesn’t get completely cleaned off your system until you reboot. If you are not trying to reinstall the same service (or a service of the same name), then you should have no problems.
If you are trying to reinstall the service, and don’t want to have to reboot before doing so, here are some things to check:
• Make sure the service is stopped before you uninstall it.
• Close the Services MMC console while you do the uninstall. The snapin can hold onto the service registry keys and not allow them to be deleted properly until the snapin is closed or the system is rebooted.