Le code
@echo off for /f "tokens=1,2,3" %%i in ('query session') do (echo %%i | find /I "ica" && logoff %%k /V)