我遇到了 IIS 无法正常关闭的问题。换句话说,当我们执行标准的 NET STOP / NET START 序列时,我们最终会得到一个正在关闭的服务...永远。这导致我的应用程序部署在尝试重新启动 IIS 时失败。
我本想改用 taskkill。但下面的结果让我很困惑。taskkill 报告成功终止,但进程仍然存在。
我如何让 taskkill 完成需要做的事情?
Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. All rights reserved.
C:\Users\Administrator>tasklist /svc|find "W3SVC"
svchost.exe 1456 W3SVC, WAS
C:\Users\Administrator>taskkill /PID 1456 /F
SUCCESS: The process with PID 1456 has been terminated.
C:\Users\Administrator>tasklist /svc|find "W3SVC"
svchost.exe 1456 W3SVC, WAS
C:\Users\Administrator>taskkill /PID 1456 /F
ERROR: The process with PID 1456 could not be terminated.
Reason: There is no running instance of the task.
C:\Users\Administrator>tasklist /svc|find "W3SVC"
svchost.exe 1456 W3SVC, WAS
C:\Users\Administrator>