Tuesday, September 8, 2009

Removing a service manually in Windows Server 2008

I was writing a test Windows Service and accidentally removed it through the Programs and Features dialog, which removes the files, but doesn't actually remove the service from the service list. So when I tried to install the 2nd version of this test service it was complaining that it already existed.

I looked around a little and found that I could delete the Service from the registry in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\[Your service]. I deleted the key (the little folder thingy) and it did show some change, but my service was still there and the newer version still wouldn't install.

After a little more looking around I found out that to fix it I could use sc delete [YourService] to fix it. And it did!

Next time, though, I really should use the installer I used to install it to remove it...

16 comments:

  1. Hey Dude,

    This realy helped me saving my problemn.

    Great blog,
    H. Sals

    ReplyDelete
  2. Hey man, just saved me a lot of work, thanks so much :-)

    ReplyDelete
  3. Thanks a lot dude. this helped me as well

    ReplyDelete
  4. WOOT! First hit on Google, solved my problem.

    ReplyDelete
  5. Same here, never heard of that command, but it worked great!

    ReplyDelete
  6. Thank you, this is very useful!

    ReplyDelete
  7. Thanks! Helped me too :)

    ReplyDelete
  8. You’ll need to open up a command prompt, and if you are using Windows 7 or Vista you’ll need to right-click the command prompt and choose Run as Administrator. We’ll use the sc command to actually do the work.

    The syntax used to delete a service is this:

    sc delete ServiceName

    If your service name has spaces in it, you’ll need to wrap the service name in quotes, like this:

    sc delete “Adobe LM Service”

    ReplyDelete
  9. Thanks. Works on Win 2008 too.

    ReplyDelete
  10. thanks man, that really solved my problem and had no problem finding the solution.

    First link on google and job done.

    ReplyDelete
  11. Thanks.. Saved my time.. :)

    ReplyDelete
  12. This is terrific.
    But, the program I have installs as two services and while the command deleted the first service, the second one won't budge (I tried the double quotes).

    ReplyDelete
  13. Pretty cool, my service stuck in there for a while because some bug in the code. Now I find the resolution. Thanks very much

    ReplyDelete
  14. During onee oof these hook-ups Pardo believes Khloe
    Kardashian was conceived. The Mahala by Jimjmy Choo is quite
    classy, and every bit as desxigner as the shoe line.

    In an analog multimeter, the range has to be adjusted by the user.


    Here is my web site :: the simpsons tapped out cheats

    ReplyDelete