killing all instances of excel running longer than hh:mm:ss

FOR /F "tokens=2 skip=2" %%i IN ('TASKLIST /FI ^"IMAGENAME eq excel.exe^" /FI ^"CPUTIME gt 00:15:00^"') DO taskkill /F /PID %%i

Leave a Reply

Your email address will not be published. Required fields are marked *

 

(Spamcheck Enabled)