当我尝试开始这样的服务时,我对一项停留在起步阶段的服务有问题,而我无法终止这一过程。我知道重新启动是一种解决方案,但是服务器不能每天重新启动几次,也不允许安装和使用Process之类的附加软件。
到目前为止,我尝试使用以下解决方案(所有命令都以admin的形式执行):
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
发布于 2022-07-13 08:37:41
1-以管理员身份运行PowerShell
2-输入:Get-Service
类似于这个图片输入Get-Service命令后
3-输入:Stop-Service -Name "SERVICE-NAME"
喜欢这张图片
4-如果服务没有停止,请尝试以下命令
Set-Service -Name "SERVICE-NAME" -Status stopped -force
另一个解决方案:
1-以管理员身份打开powershell或CMD。
2- {服务路径} -k netsvcs
https://stackoverflow.com/questions/72962938
复制相似问题