Well, chances are, you're trying to uninstall a windows service.
This error tends to happen when you don't stop the service before attempting to uninstall it or/and some associated process or handle hangs around, preventing the service from being uninstalled.
One common culprit is services.msc - it's particularly bad because if you've been a good little monkey and stopped the service before running your uninstaller, you probably still have the services.msc window open.
Before you go restarting the machine etc, MAKE SURE YOU CLOSE SERVICES.MSC, in your session and any other active rdp session.
If you close and reopen the console, you'll probably find that your service has now been successfully deleted.
you saved my day thx
ReplyDeleteThanks alot .. you saved my day too :)
ReplyDeleteThanks A lot..Saved my big day too..
ReplyDeleteThanks man.. you save my whole night ... :)
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteDid NOT work for me. Need another way to clear this error or "service is marked for deletion" besides rebooting. There are no services.msc windows open. Yes, i did delete the 'psexec' service before stopping it. Yes, I've exited out of the services window. Bottom line: Microsoft should NOT allow a "started/running" service to be deleted, or Microsoft's "sc delete" should, by design, 'stop' the service, before letting the delete succeed.
ReplyDeleteOkay, FOUND the trick! Although ALL services.msc windows were closed, and the service had been deleted with "sc delete" (before stopping it), then it was hung in that "marked for deletion" state. Well, just use pstools "pslist" and "pskill," after you find the remote PC's process for PSEXEC or whichever process is hung, then kill that service. I used "SCCM Client Center," connected to the PC with the hung service state, then went to "Running Executions," clicked "Show processes," found the "PSEXEC" process still active & running, right-click, "Kill Process." Done - FIXED - no reboot needed. Cheers!
ReplyDelete