variables in parenthesis block in Windows script

Viewed 18

What's wrong with the following Windows cmd script? I want to be able to set a variable in the () block.

set targLangs=es mh
for %%t in (%targLangs%) do (
    set targDir=P_%%t
    echo %targDir%
)

In running the above, %targDir% evaluates to blank.

0 Answers
Related