Hello,
Has anyone used taskkill on Win XP in an if condition? I want to use it as a watchdog to restart a program in case it leaks memory and grows too big by adding it in an unending loop.
For example with the following command I can kill Internet Explorer if its memory usage is greater than 40kb (will happen every time):
taskkill /f /fi "imagename eq iexplore.exe" /fi "memusage gt 40"
What I want to do now is something like this:
set MY_COMM=taskkill /f /fi "imagename eq iexplore.exe" /fi "memusage gt 40" if %MY_COMM% equ 0 ( "C:\Program Files\Internet Explorer\IEXPLORE.EXE" ) else ( echo no internet explorer found )
TIA, Bert