首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >当系统上没有Windows服务的可执行文件时,如何卸载它?

当系统上没有Windows服务的可执行文件时,如何卸载它?
EN

Stack Overflow用户
提问于 2008-12-01 13:31:16
回答 6查看 309.9K关注 0票数 183

如果系统上没有Windows服务的可执行文件,如何卸载该服务?我不能运行installutil -u,因为系统上没有剩余的可执行文件。我仍然可以在服务控制台中看到该服务的条目。

出现这种状态的原因可能是因为msi包中的一个问题,它没有正确地删除服务,但是一旦服务处于这种状态,我如何修复它呢?

EN

回答 6

Stack Overflow用户

回答已采纳

发布于 2008-12-01 13:43:24

您应该能够使用sc.exe卸载它(我认为它包含在Windows资源工具包中),方法是在“管理员”命令提示符下运行以下命令:

代码语言:javascript
复制
sc.exe delete <service name>

其中,<service name>是您在服务管理控制台中看到的服务本身的名称,而不是exe的名称。

您可以在System文件夹中找到sc.exe,它需要具有管理权限才能运行。More information in this Microsoft KB article

或者,您也可以直接调用DeleteService()接口。这种方式有点复杂,因为您需要通过OpenSCManager()等获取服务控制管理器的句柄,但另一方面,它使您能够更好地控制正在发生的事情。

票数 353
EN

Stack Overflow用户

发布于 2008-12-01 13:35:43

found here

我刚在windows XP上试过,它起作用了。

本地计算机: sc \。删除服务名称

代码语言:javascript
复制
  Deleting services in Windows Server 2003

  We can use sc.exe in the Windows Server 2003 to control services, create services and delete services. Since some people thought they must directly modify the registry to delete a service, I would like to share how to use sc.exe to delete a service without directly modifying the registry so that decreased the possibility for system failures.

  To delete a service: 

  Click “start“ - “run“, and then enter “cmd“ to open Microsoft Command Console.

  Enter command:

  sc servername delete servicename

  For instance, sc \\dc delete myservice

  (Note: In this example, dc is my Domain Controller Server name, which is not the local machine, myservice is the name of the service I want to delete on the DC server.)

  Below is the official help of all sc functions:

  DESCRIPTION:
    SC is a command line program used for communicating with the
    NT Service Controller and services. 
  USAGE:
          sc
票数 11
EN

Stack Overflow用户

发布于 2008-12-01 23:30:40

我最喜欢的方式是使用Sysinternals Autoruns应用程序。只需选择该服务,然后按delete。

票数 10
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/330836

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档