Thursday, 21 August 2014

CMD - kill task on remote machines in txt file

@echo off

set LISTFILE=clients.txt

for /f %%a in (%LISTFILE%) do (

    echo.
    echo --------------------------------
    echo.
    echo. %%a
    ping -n 1 %%a | find "TTL="
        if not errorlevel 1 (
            TASKKILL /s %%a /IM iexplore.exe
            )
    )

pause

No comments:

Post a Comment