如何解决“指定的服务已被标记为删除"错误

编程入门 行业动态 更新时间:2024-10-15 22:26:00
本文介绍了如何解决“指定的服务已被标记为删除"错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我尝试使用 sc delete 删除 Windows 服务,但遇到以下错误:

I try to remove a Windows Service with sc delete <service name>, and encounter the following error:

[SC] 删除服务失败 1072:

[SC] DeleteService FAILED 1072:

指定的服务已被标记为删除.

The specified service has been marked for deletion.

我已经做过的:

显然停止了服务.sc queryex "" 给出以下结果:

SERVICE_NAME: Stub service
        TYPE               : 10  WIN32_OWN_PROCESS
        STATE              : 1  STOPPED
        WIN32_EXIT_CODE    : 1067  (0x42b)
        SERVICE_EXIT_CODE  : 0  (0x0)
        CHECKPOINT         : 0x0
        WAIT_HINT          : 0x0
        PID                : 0
        FLAGS              :

确保 Microsoft 管理控制台已关闭 (taskkill/F/IM mmc.exe),

确保事件查看器已关闭、

删除了键 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\<服务名称>来自注册表.

由于此次删除,services.msc 仍然显示该服务(有名称,但没有状态或启动类型),但描述为<无法读取描述.错误代码:2 >".尝试查看属性时,系统找不到指定的文件."显示了五次.

Due to this removal, services.msc still shows the service (with a name, but no status or startup type), but the description is "<Failed to Read Description. Error Code: 2 >". When attempting to view the properties, "The system cannot find the file specified." is shown five times.

问题依旧.

下一步是什么?

推荐答案

导致服务卡在标记为删除"的原因可能有多种.

There may be several causes which lead to the service being stuck in "marked for deletion".

SysInternals 的 Process Explorer 是打开.关闭它应该会导致服务自动删除.

SysInternals' Process Explorer is opened. Closing it should lead to automatic removal of the service.

任务管理器已打开.

Microsoft 管理控制台 (MMC) 已打开.为确保关闭所有实例,请运行 taskkill/F/IM mmc.exe.

Microsoft Management Console (MMC) is opened. To ensure all instances are closed, run taskkill /F /IM mmc.exe.

服务控制台已打开.这与上一点相同,因为服务控制台由 MMC 托管.

Services console is opened. This is the same as the previous point, since Services console is hosted by MMC.

事件查看器已打开.同样,这与第三点相同.

Event Viewer is opened. Again, this is the same as the third point.

键 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\{service name} 存在.

其他人登录到服务器并打开了前面提到的应用程序之一.

Someone else is logged into the server and has one of the previously mentioned applications opened.

一个用于调试服务的 Visual Studio 实例已打开.

这篇关于如何解决“指定的服务已被标记为删除"错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-25 12:56:07,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1116640.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:已被   如何解决   标记   错误   quot

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!