简体   繁体   中英

Cannot delete windows 7 service

I have a service called "ABC". Now I am trying to delete the service from cmd in administrator mode:

sc delete "A B C"

but that gives:

C:\>sc delete "A B C"
[SC] OpenService FAILED 1060:

The specified service does not exist as an installed service.

The service is present in the service manager and is set to automatic. How do I delete it?

http://antivirus.about.com/od/securitytips/ht/how-to-delete-windows-service.htm

Since you mentioned that "is set to automatic", it could not be deleted already.

  1. Make sure you have the correct service name. A service can have a service name , and a display name which is different from the former.
  2. If this is a service created by a virus, it is quite possible that OpenService is hooked to keep virus alive, and ordinary method does not work in this situation. Try some anti-virus toolkits, like PsService in Sysinternals Suite or XueTr .

In my case I first tried...

sc delete "MyService Name"

and received error 1072 . I had the services window list up looking at all my services. I then tried to close the windows service list and tried to run...

sc delete "MyService Name"

and received error 1062 . I opened back up the windows service list and found that the service was gone. It could have been pending removal in the first place but the fact of the matter is I simply had to close the windows service list window.

On a side note, a service name and friendly service name can differ. Make sure you know the real service name! To get the actual service name open windows services list and find the service your interested in, we will call it "My Ugly Service". Then open a command prompt and type the following...

sc GetKeyName "My Ugly Service"

It will return the actual name similar to "MyUglySrv" . Then just simply type the following (AFTER YOU CLOSE ALL WINDOWS THAT HAVE THE SERVICE INVOLVED, such as windows services list)...

sc delete "MyUglySrv"

To see both the Display and Service name for both running and stopped services, enter on a command line:
C:\\>sc query type= service state= all

Change all to active or inactive to see that particular type of service.

Some folder deleted manually and it create problem sometime,

Re install service again closed all open folder ,service and task manager un install services

*if service not delete then just run following with administrator privilege * run command SC delete postgresql-x64-9.6 (service name )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM