DOS for循环 的赋值

2024-12-03 12:24:32
推荐回答(2个)
回答1:

setlocal enabledelayedexpansion
set dm=500019
for /l %%i in (300,1,310) do (
set /a dm = !dm!+1
for /f %%j in (a300.txt) do (
set var=%%j
call set "var=%%var:500019=!dm!%%"
echo !var!>>a%%i.txt
)
)

回答2:

把%dm%改为!dm!