taskkill - Batch script to kill a process if not responding in a for loop -
i trying install windows standalone update files , need use wusu.exe. every , again wusu.exe hang. have created batch file called prereqs.bat , in file have calls wusu.exe. need code kill wusu.exe if hangs, , retry again.
this code stands now:
:prereqs32 taskkill /im prereqs32.bat /f taskkill /im wusa.exe /f
when loops back, kills both batch file , wusa.exe
start cmd /k c:\windows\temp\prereqs.bat
an outside process can kill wusu.exe if things go awry.
timeout /t 240 /nobreak
this timeout wait until install complete not enough.
taskkill /im "[wusa.exe]" /fi "status eq not responding" if "%errorlevel%"=="1" goto prereqs32
is there way sort of loop, logic exit if status not "not responding"?
also, bonus, there way forgo timeout , "wait" prereqs.bat complete before moving on, assuming wusu.exe has not hung?
Comments
Post a Comment