Remove a Service from the Command Prompt

Date September 29, 2007

image Ever have one of those programs that just won’t uninstall cleanly? I especially hate it when a program leaves a bunch of services that still manage to start, and lock files in their directory.

I ran across a nifty command to help remove at least the service portion of those programs, so that you can then remove the files in those folders. In a command prompt just type:

“SC delete %servicename%”

The tricky part to this is that the service name isn’t necessarily what appears in the services applet.

If you open the service that you want to delete, the top of the general tab has “Service name:” on top. That is the service name that you should use.

If we were removing the “Google Updater Service” in the picture below. We would use the name “gusvc”. Click on the picture for the full sized version.

image

Also on Port 16:

  • The necessary services are disabled or unavailable. Error 0×80246007
  • Day 6: T-Bone with Bistro Dipping Sauce
  • Bit of a "duh" moment
  • Day 1: Disco’s Hot and Tangy Pork Loin?
  • Download Large Files later with WinWget
  • Announcing the Second Annual Command of the Grill Week
  • AddThis Social Bookmark Button AddThis Feed Button

    3 Responses to “Remove a Service from the Command Prompt”

    1. Phil said:

      Hey Mike, this is a really cool tip. Thanks. One thing that took me a minute was to see the “gusvc” on the screenshot. Would it be possible to add a red circle or something to guide the readers eye?

    2. art said:

      Ever have one of those programs that just won’t uninstall cleanly?

      You mean all of them? I haven’t met a Windows program that doesn’t at least leave behind it’s folder in Program Files, or files in your Documents and Settings folder, or registry entries, or…. You get the idea.

      Anyway, this is a nice tip. I need to use it once in a while, and I always have to search it out every time because I can never remember it.

    3. Mike Scott said:

      @Phil, thanks for the suggestion. I placed a nice red oval around it. That should make it easier for people to find. I’ll have to keep that in mind for future posts.

      @Art, I know. The thing I always hate is when it doesn’t remove the service, and then you can’t delete the folder because it is in use. I just don’t understand why uninstall scripts can’t be written a little better.

    Leave a Reply

    XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>