3

How do I kill an unresponsive process or task in Windows when it becomes completely unresponsive (window becomes a ligt grey, cursor a rotating blue ring)?

  • Clicking [X] or trying to end process in taskmgr has no effect [status is unresponsive].
  • Task can't be killed using Process Explorer [procexp] or with any of the following:
    TaskKill /f /pid %pid%
    
    TaskKill /f /im %exec.exe%
    
    Stop-Process -Force -Name $name
    
5
  • Well, in such situations, I always know how to end them: shutdown /r /t 0 and they are killed for good... Dec 27, 2020 at 8:41
  • No replies? Then it seems the only right answer really is restarting... Dec 27, 2020 at 9:20
  • For explanation see Can't kill a sleeping process (Linux but applies here too).
    – harrymc
    Dec 27, 2020 at 9:49
  • But I am on Windows... Dec 27, 2020 at 10:11
  • @harrymc That only explains it, I can confirm it's the same case, but it doesn't provide any real solution... Dec 27, 2020 at 10:15

2 Answers 2

1

To end unkillable processes, use WMIC [Windows Management Instrumentation Console] in cmd or powershell, replace the variables with the PID/name of the process to kill:

  • cmd (variable: %pid%):
    WMIC Process where ProcessID=%pid% delete
    
  • powershell (variable: ${name}):
    WMIC Process where Name="${name}.exe" delete
    
1
  • Good to know but no... the commands issued result in "Access denied", it's on admin console as well.
    – JasonXA
    Feb 23, 2023 at 20:05
0

You can give a try to use this code in a batch file :

@echo off 
Mode 90,3 & color 0B
Title Killing All Applications with Status equal to NOT RESPONDING
Taskkill /f /FI "STATUS eq NOT RESPONDING"
pause

EDIT :

With Powershell you can do something like this :

Clear-Host
While ($True) {
$DateTime =$Null
$DateTime = (get-date).ToLocalTime().ToString("dd/MM/yyyy @ HH:mm:ss")
Try {
$Processes = Get-Process -EA Stop 
$nProcesses = @($Processes | ? { $_.Responding -eq $false })
#$nProcesses
} catch {            
    Write-Error "Failed to query processes. $_"            
 }            
    if($nProcesses) {            
        foreach($nProcess in $nProcesses) {            
            $nProcess | select ID,Name, MainWindowTitle,Path
            Stop-process -Force $nProcess        
    }            
} else {            
  Write-host "$DateTime - No non-responding processes found" -ForegroundColor Yellow            
 } 
 Start-Sleep -s 300
}  
1
  • Did you read my question? I said the process can't be taskkilled, it does not accept terminating signals... Dec 28, 2020 at 8:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .