07-23-2023, 10:48 AM
I have an array defined as `LIST=(a b c d e)`. The `a, b, c, d, e` are set as system variables, eg. `a=AAA, b=BBB`, etc.
In a batch script, I would like to do a for loop looking like:
for %%i in %LIST% do echo %%i=%%%i% (unfortunately, this doesn't work)
What I want to achieve is that `%%i (a) = %%%i% (%a%)`, which will be resolved as system variable, thus instead of showing `%a%`, it'll be resolved as `a=AAA`.
Do you have any idea how to do it in a batch script?
Thanks!
In a batch script, I would like to do a for loop looking like:
for %%i in %LIST% do echo %%i=%%%i% (unfortunately, this doesn't work)
What I want to achieve is that `%%i (a) = %%%i% (%a%)`, which will be resolved as system variable, thus instead of showing `%a%`, it'll be resolved as `a=AAA`.
Do you have any idea how to do it in a batch script?
Thanks!