Script to find apps with “not responding” status, kill and restart the app in Windows XP

后端 未结 1 1731
时光取名叫无心
时光取名叫无心 2021-01-24 02:10

I tried:

taskkill /f /fi \"status eq not responding\"

This is not working. Even with an application with not responding status, I have

相关标签:
1条回答
  • 2021-01-24 03:10

    I tried on Windows XP SP3 x86 the command:

    tasklist /fi "STATUS eq NOT RESPONDING"
    

    And the output was:

    INFO: No tasks running with the specified criteria.

    Next I tried the opposite:

    tasklist /fi "STATUS eq RUNNING"
    

    And the output was the same as above.

    Then I searched in world wide web for web pages about tasklist with filter on status on Windows XP and found lots of pages all reporting the same as my own tests returned:

    Filtering on status is not working on Windows XP.

    This is obviously a bug of tasklist and taskkill on Windows XP.

    The newer tasklist documentation of Microsoft for Windows Server 2000 and later as well as the referenced documentation above for Windows XP contain both two tasklist examples with the filter option /fi "STATUS eq running" on command line. But both output on Windows XP just:

    INFO: No tasks running with the specified criteria.

    Removing /fi "STATUS eq running" from each example and run tasklist with the remaining parameter results in expected output.

    So I thought about working around this bug of tasklist and taskkill on my German Windows XP by using

    tasklist /v /fi "USERNAME ne NT-AUTORITÄT\SYSTEM" /fi "USERNAME ne NT-AUTORITÄT\NETZWERKDIENST"
    

    and filter the output for task with not responding in output.

    But this also does not work. I let a GUI application run into an endless loop and therefore showing the status Not Responding (German: Keine Rückmeldung) on tab Applications in Windows Task Manager. But in output of command above the GUI application was still listed with status Running (German: Wird ausgeführt).

    It looks like it is really impossible on Windows XP using tasklist or taskkill to find and kill applications with status not responding in Windows Task Manager from command line.

    0 讨论(0)
提交回复
热议问题