@echo off setlocal enabledelayedexpansion rem Define array of strings set strings[0]=3005 B1 c1 = 3005 B2 s1; set strings[1]=3023 P1 r2 = 3023 P2 l2; set strings[2]=3710 T3 s4 = 3710 T4 s3; rem Path to ldcad32.exe (if not in PATH, set the full path) set "LDCAD=ldcad32.exe" rem Loop through array set i=0 :loop set "line=!strings[%i%]!" if defined line ( rem Generate .ldr file echo !line! | ls2ldr.exe > "!line!.ldr" echo Created "!line!.ldr" rem Launch ldcad32 and wait for it to close start /wait "" "%LDCAD%" "!line!.ldr" echo Closed LDCad for "!line!.ldr" set /a i+=1 goto loop ) endlocal