windows PID 存在于 netstat 但不存在于任务管理器中
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15216881/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
PID exists in netstat but does not exist in task manager
提问by shawn
I have discovered a running process with PID 26376 listening on port 9001 and 9002 as when I try to run my program(as a service) which binds to that port it fails.
我发现了一个正在运行的进程,PID 为 26376 正在侦听端口 9001 和 9002,因为当我尝试运行绑定到该端口的程序(作为服务)时,它失败了。
But when I try to kill it using taskkill /PID it says that the process 26376 is not found. Similarly when I try to find the process in task manager with "Show processes from all users" selected, I couldn't find it anywhere.
但是当我尝试使用 taskkill /PID 杀死它时,它说找不到进程 26376。同样,当我尝试在选择了“显示所有用户的进程”的任务管理器中查找进程时,我在任何地方都找不到它。
Can anyone explain this? Is it a defunct zombie process? I suspect that the process listening on that port is a previous instance of my program running but what could have caused this?
谁能解释一下?它是一个不复存在的僵尸进程吗?我怀疑在该端口上侦听的进程是我的程序运行的先前实例,但可能是什么原因造成的?
EDIT: Sysinternals TCPView shows the process as non-existent. Sysinternals Process Explorer does not show the process. Tasklist does not show the process.
编辑:Sysinternals TCPView 显示该进程不存在。Sysinternals Process Explorer 不显示进程。任务列表不显示进程。
回答by Parth Mody
You don't need Task Manager for tracking this. Just run netstat -b
which will display the exe associated with the PID..
你不需要任务管理器来跟踪这个。只需运行netstat -b
这将显示与 PID 关联的 exe..
回答by mfck
Well, in my case killing all the conhost.exe instances owned by the same user as the initial process released the port.
好吧,就我而言,在初始进程释放端口时,杀死同一用户拥有的所有 conhost.exe 实例。
回答by ch271828n
(improved from @mfck's answer)
(从@mfck 的回答中改进)
- kill all processes named
cmd.exe
- kill all processes named
conhost.exe
- 杀死所有命名的进程
cmd.exe
- 杀死所有命名的进程
conhost.exe
回答by Blaise Brignac
Another option is to bounce the NIC associated with the connection. Be careful if you are doing this over RDP, you'll want to script it so the NIC will come back online or you'll lock yourself out and will need console access.
另一种选择是退回与连接关联的 NIC。如果您通过 RDP 执行此操作,请小心,您需要编写脚本以便 NIC 重新联机,否则您将自己锁定并需要控制台访问权限。
This link explains how to do it with CMD and powershell:
此链接解释了如何使用 CMD 和 powershell 执行此操作:
https://www.windowscentral.com/how-enable-or-disable-wi-fi-and-ethernet-network-adapters-windows-10
https://www.windowscentral.com/how-enable-or-disable-wi-fi-and-ethernet-network-adapters-windows-10