首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何消除Windows服务进程在启动时遇到的问题?

如何消除Windows服务进程在启动时遇到的问题?
EN

Stack Overflow用户
提问于 2022-07-13 08:12:28
回答 1查看 253关注 0票数 -1

当我尝试开始这样的服务时,我对一项停留在起步阶段的服务有问题,而我无法终止这一过程。我知道重新启动是一种解决方案,但是服务器不能每天重新启动几次,也不允许安装和使用Process之类的附加软件。

到目前为止,我尝试使用以下解决方案(所有命令都以admin的形式执行):

代码语言:javascript
运行
复制
taskkill /f /pid 7788
ERROR: The process with PID 7788 could not be terminated.
Reason: Access is denied.

C:\Windows\system32>wmic
wmic:root\cli>process where name="ProcesName.exe" delete
Delete '\\xxxxx\ROOT\CIMV2:Win32_Process.Handle="7788"' (Y/N/?)? y
Deleting instance \\xxxxx\ROOT\CIMV2:Win32_Process.Handle="7788"
ERROR:
Description = Access denied
wmic:root\cli>


C:\Windows\system32>wmic
wmic:root\cli>process where name="ProcesName.exe" call terminate
Execute (\\xxxxx\ROOT\CIMV2:Win32_Process.Handle="7788")->terminate() (Y/N/?)? y
Method execution successful.
Out Parameters:
instance of __PARAMETERS
{
        ReturnValue = 2;
};

wmic:root\cli>


C:\Windows\system32>taskkill /IM "ProcessName.exe" /T /F
ERROR: The process with PID 7788 (child process of PID 680) could not be terminated.
Reason: Access is denied.

C:\Windows\system32>tasklist | findstr 680
services.exe                   680 Services                   0      9 084 K
java.exe                      5832 Services                   0    443 680 K
EN

回答 1

Stack Overflow用户

发布于 2022-07-13 08:37:41

1-以管理员身份运行PowerShell

2-输入:Get-Service类似于这个图片输入Get-Service命令后

3-输入:Stop-Service -Name "SERVICE-NAME"喜欢这张图片

关于停止服务的示例

停车后服务效果

4-如果服务没有停止,请尝试以下命令

代码语言:javascript
运行
复制
Set-Service -Name "SERVICE-NAME" -Status stopped -force

另一个解决方案:

1-以管理员身份打开powershell或CMD。

2- {服务路径} -k netsvcs

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

https://stackoverflow.com/questions/72962938

复制
相关文章

相似问题

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