CODE: [Copy to clipboard]@echo off setlocal enabledelayedexpansion set n=0 for /f "tokens=*" %%a in (test.txt) do ( set /a n+=1 set var!n!=%%a )