WINDOWS自带的无敌kill进程命令

此方法可以杀掉任务管理器杀不掉的进程!
问:怎么才能关掉一个用任务管理器关不了的进程?我前段时间发现我的机子里多了一个进程,只要开机就在,我用任务管理器却怎么关也关不了 
  
答1:杀进程很容易,随便找个工具都行。比如IceSword。关键是找到这个进程的启动方式,不然下次重启它又出来了。顺便教大家一招狠的。其实用Windows自带的工具就能杀大部分进程: 
  
  c:>ntsd -c q -p PID 
  

  只有System、SMSS.EXE和CSRSS.EXE不能杀。前两个是纯内核态的,最后那个是Win32子系统,ntsd本身需要它。ntsd从
2000开始就是系统自带的用户态调试工具。被调试器附着(attach)的进程会随调试器一起退出,所以可以用来在命令行下终止进程。使用ntsd自动
就获得了debug权限,从而能杀掉大部分的进程。ntsd会新开一个调试窗口,本来在纯命令行下无法控制,但如果只是简单的命令,比如退出(q),用
-c参数从命令行传递就行了。NtsdNtsd 按照惯例也向软件开发人员提供。只有系统开发人员使用此命令。有关详细信息,请参阅 NTSD
中所附的帮助文件。用法:开个cmd.exe窗口,输入: 
  
  ntsd -c q -p PID 
  
  把最后那个PID,改成你要终止的进程的ID。如果你不知道进程的ID,任务管理器->进程选项卡->查看->选择列->勾上"PID(进程标识符)",然后就能看见了。 
  
答2:xp下还有两个好东东tasklist和tskill。tasklist能列出所有的进程,和相应的信息。tskill能查杀进程,语法很简单:tskill 程序名!! 
  
  
附:NTSD 中所附的帮助文件 
  
usage: ntsd [-?] [-2] [-d] [-g] [-G] [-myob] [-lines] [-n] [-o] [-s] [-v] [-w] 
  [-r BreakErrorLevel] [-t PrintErrorLevel] 
  [-hd] [-pd] [-pe] [-pt #] [-pv] [-x | -x{e|d|n|i} ] 
  [-- | -p pid | -pn name | command-line | -z CrashDmpFile] 
  [-zp CrashPageFile] [-premote transport] [-robp] 
  [-aDllName] [-c "command"] [-i ImagePath] [-y SymbolsPath] 
  [-clines #] [-srcpath SourcePath] [-QR /machine] [-wake ] 
  [-remote transport:server=name,portid] [-server transport:portid] 
  [-ses] [-sfce] [-sicv] [-snul] [-noio] [-failinc] [-noshell] 
  
where: -? displays this help text 
  command-line is the command to run under the debugger 
  -- is the same as -G -g -o -p -1 -d -pd 
  -aDllName sets the default extension DLL 
  -c executes the following debugger command 
  -clines number of lines of output history retrieved by a remote client 
  -failinc causes incomplete symbol and module loads to fail 
  -d sends all debugger output to kernel debugger via DbgPrint 
  -d cannot be used with debugger remoting 
  -d can only be used when the kernel debugger is enabled 
  -g ignores initial breakpoint in debuggee 
  -G ignores final breakpoint at process termination 
  -hd specifies that the debug heap should not be used 
  for created processes. This only works on Windows Whistler. 
  -o debugs all processes launched by debuggee 
  -p pid specifies the decimal process Id to attach to 
  -pd specifies that the debugger should automatically detach 
  -pe specifies that any attach should be to an existing debug port 
  -pn name specifies the name of the process to attach to 
  -pt # specifies the interrupt timeout 
  -pv specifies that any attach should be noninvasive 
  -r specifies the (0-3) error level to break on (SeeSetErrorLevel) 
  -robp allows breakpoints to be set in read-only memory 
  -t specifies the (0-3) error level to display (SeeSetErrorLevel) 
  -w specifies to debug 16 bit applications in a separate VDM 
  -x sets second-chance break on AV exceptions 
  -x{e|d|n|i} sets the break status for the specified event 
  -2 creates a separate console window for debuggee 
  -i ImagePath specifies the location of the executables that generated 
  the fault (see _NT_EXECUTABLE_IMAGE_PATH) 
  -lines requests that line number information be used if present 
  -myob ignores version mismatches in DBGHELP.DLL 
  -n enables verbose output from symbol handler 
  -noio disables all I/O for dedicated remoting servers 
  -noshell disables the .shell (!!) command 
  -QR  queries for remote servers 
  -s disables lazy symbol loading 
  -ses enables strict symbol loading 
  -sfce fails critical errors encountered during file searching 
  -sicv ignores the CV record when symbol loading 
  -snul disables automatic symbol loading for unqualified names 
  -srcpath specifies the source search path 
  -v enables verbose output from debugger 
  -wake wakes up a sleeping debugger and exits 
  -y specifies the symbol search path (see _NT_SYMBOL_PATH) 
  -z specifies the name of a crash dump file to debug 
  -zp specifies the name of a page.dmp file 
  to use with a crash dump 
  -remote lets you connect to a debugger session started with -server 
  must be the first argument if present 
  transport: tcp | npipe | ssl | spipe | 1394 | com 
  name: machine name on which the debug server was created 
  portid: id of the port the debugger server was created on 
  for tcp use: port= 
  for npipe use: pipe= 
  for 1394 use: channel= 
  for com use: port=,baud=, 
  channel= 
  for ssl and spipe see the documentation 
  example: ... -remote npipe:server=yourmachine,pipe=foobar 
  -server creates a debugger session other people can connect to 
  must be the first argument if present 
  transport: tcp | npipe | ssl | spipe | 1394 | com 
  portid: id of the port remote users can connect to 
  for tcp use: port= 
  for npipe use: pipe= 
  for 1394 use: channel= 
  for com use: port=,baud=, 
  channel= 
  for ssl and spipe see the documentation 
  example: ... -server npipe:pipe=foobar 
  -premote transport specifies the process server to connect to 
  transport arguments are given as with remoting 
  
Environment Variables: 
  
  _NT_SYMBOL_PATH=[Drive:][Path] 
  Specify symbol image path. 
  
  _NT_ALT_SYMBOL_PATH=[Drive:][Path] 
  Specify an alternate symbol image path. 
  
  _NT_DEBUGGER_EXTENSION_PATH=[Drive:][Path] 
  Specify a path which should be searched first for extensions dlls 
  
  _NT_EXECUTABLE_IMAGE_PATH=[Drive:][Path] 
  Specify executable image path. 
  
  _NT_SOURCE_PATH=[Drive:][Path] 
  Specify source file path. 
  
  _NT_DEBUG_LOG_FILE_OPEN=filename 
  If specified, all output will be written to this file from offset 0. 
  
  _NT_DEBUG_LOG_FILE_APPEND=filename 
  If specified, all output will be APPENDed to this file. 
  
  _NT_DEBUG_HISTORY_SIZE=size 
  Specifies the size of a server's output history in kilobytes 
  
Control Keys: 
  
  Quit debugger 
  Break into Target 
  Force a break into debuggee (same as Ctrl-C) 
  Debug Current debugger 
  Toggle Verbose mode 
  Print version information 
ntsd: exiting - press enter --- 

<think>我们正在讨论Windows系统中用于杀死进程命令。根据之前引用的内容,我们可以总结出以下方法: 1. 使用`taskkill`命令通过进程ID(PID)杀死进程: ``` taskkill /pid <PID> -f ``` 其中`/pid`指定进程ID,`-f`表示强制结束进程2. 使用`taskkill`命令通过映像名称(即进程名)杀死进程: ``` taskkill /im <进程名> -f ``` 其中`/im`指定映像名称(Image Name),`-f`表示强制结束。 3. 结合`tasklist`和`findstr`命令查找特定进程,然后通过管道传递给`taskkill`(需要借助批处理): ``` tasklist | findstr "进程名" ``` 获取到进程信息(包括PID)后,再使用`taskkill`。 或者使用for循环直接杀死: ``` for /f "tokens=2" %i in ('tasklist ^| findstr "进程名"') do taskkill /f /pid %i ``` 注意:在批处理文件中使用`for`循环时,变量`%i`需要写成`%%i`。 示例: - 杀死所有名为`notepad.exe`的进程: ``` taskkill /f /im notepad.exe ``` - 杀死PID为1234的进程: ``` taskkill /f /pid 1234 ``` - 杀死所有`chrome.exe`进程(当有多个同名进程时): ``` taskkill /f /im chrome.exe ``` 引用说明: - 引用[2]提供了通过进程ID结束进程的方法。 - 引用[3]展示了如何结合`tasklist`和`findstr`查找进程。 §§相关问题§§ 1. 如何查看Windows系统中正在运行的进程2. 除了`taskkill`,还有哪些方法可以结束Windows进程? 3. 如何结束远程计算机上的进程? 4. 如何通过编程方式(如C#、Python)结束Windows进程? </think>在 Windows 系统中,杀死进程的常用命令是 `taskkill`,主要通过以下两种方式实现: ### 一、通过进程ID(PID)终止进程 ```bash taskkill /pid <进程号> /f ``` - **`/pid`**:指定目标进程的ID - **`/f`**:强制终止进程(包括其所有子进程- **示例**:杀死PID为`9396`的进程 ```bash taskkill /pid 9396 /f ``` ### 二、通过进程名称终止进程 ```bash taskkill /im <进程名> /f ``` - **`/im`**:指定目标进程的映像名称(可带`.exe`后缀) - **示例**:杀死所有`chrome.exe`进程 ```bash taskkill /im chrome.exe /f ``` ### 三、进阶用法(查找并杀死进程) 1. **查找特定进程**: ```bash tasklist | findstr "chrome" ``` 输出示例: ``` chrome.exe 8448 Console 1 148,000 K ``` 2. **管道组合命令**(查找并杀死): ```bash tasklist | findstr "chrome" && taskkill /im chrome.exe /f ``` > **注意事项**: > - 需要管理员权限才能终止系统关键进程 > - `/f` 参数可能导致未保存数据丢失,慎用 > - 进程名不区分大小写,但需准确匹配[^2][^3]
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值