Hallo all, I have a rather simple question : this works : @echo on for /f "delims=" %%g in ('findstr /I /R /C:"^ *.testdata" %file%') do set var=%%g Output : ... set var=2: <testdata file="someFile.txt"/> But when I try to do this : @echo off for /f "delims=" ...