我想杀死我的台式电脑中的 fastboot_cmd.exe 进程,tasklist
输出:
Image Name PID Session Name Session# Mem Usage
========================= ======== ================ =========== ============
System Idle Process 0 Services 0 24 K
System 4 Services 0 368 K
svchost.exe 708 Services 0 7,764 K
...
audiodg.exe 8260 Services 0 18,368 K
fastboot_cmd.exe 8240 Console 1 4,140 K
tasklist.exe 1864 Console 1 6,012 K
然后我就跑了taskkill
E:\>taskkill /F /T /IM fastboot_cmd.exe
SUCCESS: The process with PID 8240 (child process of PID 6228) has been terminat
ed.
但实际上这个过程仍然在tasklist
,
Image Name PID Session Name Session# Mem Usage
========================= ======== ================ =========== ============
System Idle Process 0 Services 0 24 K
System 4 Services 0 368 K
smss.exe 272 Services 0 464 K
...
chrome.exe 4772 Console 1 67,496 K
fastboot_cmd.exe 1964 Console 1 4,132 K
tasklist.exe 6636 Console 1 6,028 K
如何持久杀死它?
答案1
阅读您的命令输出E:\>taskkill /F /T /IM fastboot_cmd.exe
-The process with PID 8240
因此该命令只会被杀死PID 8240
,但您正在查看的PID 1964
是一个全新的实例,因此它很可能启动了一项新任务。
故障排除
任务列表 | findstr fastboot_cmd.exe
fastboot_cmd.exe
这将输出所有实例tasklist
并显示其 PID
来自我的电脑的示例:
C:\Users\Foo>tasklist | findstr cmd
cmd.exe 9556 Console 1 680 K
cmd.exe 10916 Console 1 1,352 K
cmd.exe 1024 Console 1 1,096 K
cmd.exe 4840 Console 1 6,064 K
从这里你可以看到我有多个实例所以我将运行taskkill /f /t /pid 9556 /pid 10916 /pid 1024 /pid 4840
或者:
FOR /F "tokens=2" %G IN ('tasklist ^| findstr cmd') DO taskkill /f /t /pid %G
一行代码就能搞定,记住就好
现在运行另一个tasklist | findstr fastboot_cmd.exe
并检查 PID 值,如果已更改,则系统上的某些东西在关闭后会再次启动此任务