I have two lists or sets of variables if you want that I want to access both dynamically from inside a for loop via DOS batch file. I know how to access one list in the loop but not the other. I have tried to lists and also one list with an array type set of variables. What I have so far looks like the following:
@if "%BATCH_DEBUG%"=="" echo off
SET LIST_ITEMS=(ITEM1 ITEM2 ITEm3 ITEM4)
SET /A COUNT=0
for %%x in %LIST_ITEMS% do (
REM Line below will only echo out only "TEST1"
REM Line below will echo out the full ist 'LIST_ITEMS'
REM ECHO %%x
SET /A COUNT+=1
ECHO. & ECHO Press any key to close this window...
EXIT /B 1
The script above will echo out the list 'LIST_ITEMS' but will only echo out the first variable 'OTHER_ITEMS_0'. I want to access all the variables that start with 'OTHER_ITEMS_' following the access of the array 'LIST_ITEMS'. I've tried ever combination of %, !, ", ... options I can think of and also I don't mind if all the variables of OTHER_ITEMS_ go into a list but again I want to access both list/arrays/variables in sequential order as list 'LIST_ITEMS' is accessed.