如何在 Windows 中删除服务? [英] How can I delete a service in Windows?

查看:38
本文介绍了如何在 Windows 中删除服务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有几个旧服务要完全卸载.我该怎么做?

I have a couple old services that I want to completely uninstall. How can I do this?

推荐答案

使用 SC 命令,像这样(你需要在命令提示符下才能执行这篇文章中的命令):

Use the SC command, like this (you need to be on a command prompt to execute the commands in this post):

SC STOP shortservicename
SC DELETE shortservicename

<小时>

注意:您需要以管理员身份运行命令提示符,不仅要以管理员身份登录,还要具有管理权限.如果您收到上述关于没有停止和/或删除服务所需的访问权限的错误,请以管理员身份运行命令提示符.您可以通过在开始菜单上搜索命令提示符,然后右键单击并选择以管理员身份运行"来执行此操作.PowerShell 用户注意: scset-content 的别名.所以sc delete service 实际上会创建一个名为delete 的文件,内容为service.要在 Powershell 中执行此操作,请改用 sc.exe 删除服务


Note: You need to run the command prompt as an administrator, not just logged in as the administrator, but also with administrative rights. If you get errors above about not having the necessary access rights to stop and/or delete the service, run the command prompt as an administrator. You can do this by searching for the command prompt on your start menu and then right-clicking and selecting "Run as administrator". Note to PowerShell users: sc is aliased to set-content. So sc delete service will actually create a file called delete with the content service. To do this in Powershell, use sc.exe delete service instead

如果您需要查找服务的短服务名称,请使用以下命令生成包含服务及其状态列表的文本文件:

If you need to find the short service name of a service, use the following command to generate a text file containing a list of services and their statuses:

SC QUERY state= all >"C:\Service List.txt"

要获得更简洁的列表,请执行以下命令:

For a more concise list, execute this command:

SC QUERY state= all | FIND "_NAME"

简短的服务名称将列在显示名称的正上方,如下所示:

The short service name will be listed just above the display name, like this:

SERVICE_NAME: MyService
DISPLAY_NAME: My Special Service

从而删除该服务:

SC STOP MyService
SC DELETE MyService

这篇关于如何在 Windows 中删除服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆