list - Dynamic for set in batches -
i want 2 types of lists first list types example daily , release , second type paths first list. after want dynamicly go through second type lists based on first type list.
something that:
@echo off rem ########## rem ## test ## rem ########## setlocal enabledelayedexpansion set versiontype=(daily release) set tagetsdaily=(path1 path2) set tagetsrelease=(path23 path24) %%n in %versiontype% ( echo !tagets%%n! set test_temp=!tagets%%n! echo %test_temp% %%i !tagets%%n! ( echo %%i ) ) pause exit the problem of code doesn't worked.
output:
"!tagets%n!" can syntactically processed @ point. and out secound its:
(path1 path2) echo off (off). (path23 path24) echo off (off). can me explain me why thats syntactic error , why can copy content !tagets%%n! other variable??
try this:
@echo off &setlocal enabledelayedexpansion set "versiontype=daily release" set "tagetsdaily=path1 path2" set "tagetsrelease=path23 path24" %%n in (%versiontype%) ( echo !tagets%%n! set test_temp=!tagets%%n! echo !test_temp! %%i in (!tagets%%n!) ( echo %%i ) ) please @ for /? , delayed expansion.
Comments
Post a Comment