无法删除 Windows 7 服务

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8433468/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 08:59:47  来源:igfitidea点击:

Cannot delete windows 7 service

windowswindows-services

提问by u123

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

我有一项名为“AB C”的服务。现在我试图在管理员模式下从 cmd 中删除该服务:

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

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

回答by 0902horn

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 namewhich 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 PsServicein Sysinternals Suiteor XueTr.
  1. 确保您拥有正确的服务名称。一个服务可以有一个服务名称,以及一个不同于前者的显示名称
  2. 如果这是病毒创建的服务,很有可能是挂了OpenService让病毒存活,这种情况普通的方法是行不通的。尝试一些反病毒工具包,像PsService的Sysinternals SuiteXueTr

回答by Arvo Bowen

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...

并收到错误 1072。我在服务窗口列表中查看了我的所有服务。然后我尝试关闭 Windows 服务列表并尝试运行...

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.

并收到错误 1062。我打开备份windows服务列表,发现服务不见了。它可能一开始就等待删除,但事实是我只需要关闭 Windows 服务列表窗口。

On a side note, a service nameand friendly service namecan 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...

附带说明一下,服务名称友好服务名称可能不同。确保您知道真实的服务名称!要获取实际服务名称,请打开 windows 服务列表并找到您感兴趣的服务,我们将其称为“我的丑陋服务”。然后打开命令提示符并键入以下内容...

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)...

它将返回类似于"MyUglySrv"的实际名称。然后只需键入以下内容(在您关闭所有涉及该服务的窗口后,例如 windows 服务列表)...

sc delete "MyUglySrv"

回答by Dan Aquinas

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

要同时查看正在运行和已停止服务的显示服务名称,请在命令行中输入:
C:\>sc query type= service state= all

Change allto activeor inactiveto see that particular type of service.

更改allactiveinactive看到特定类型的服务。

回答by Gaurav Deshmukh

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 )

*如果服务未删除,则只需使用管理员权限运行以下命令 *运行命令 SC delete postgresql-x64-9.6 (service name )