Created
April 30, 2021 08:38
-
-
Save u01jmg3/02f60715704072fcc8491f017d45ddd8 to your computer and use it in GitHub Desktop.
On Windows kill hung background Notepad++ processes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO off | |
FOR /F "tokens=2" %%K IN (' | |
tasklist /FI "ImageName eq notepad++.exe" /FI "Status eq Not Responding" /FO LIST ^| findstr /B "PID:" | |
') DO ( | |
:: Check for number | |
SET "var="&for /f "delims=0123456789" %%i in ("%%K") do set var=%%i | |
IF NOT DEFINED var ( | |
:: https://processhacker.sourceforge.io/ | |
ProcessHacker.exe -c -caction terminate -ctype process -cobject %%K | |
) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment