
CODE: [Copy to clipboard]我知道一个解决方法是动态生产一个.bat然后在call一下@echo off
setlocal EnableDelayedExpansion
set a1=A
set a2=B
set a3=C
set a4=D
set a5=E
for /f "tokens=*" %%i in (test.txt) do (
set /a b+=1
rem 请问下面这句应该怎样改才能显示变量a1~a5的值(也就是A~B)
echo %a!b!%
)
endlocal
CODE: [Copy to clipboard]@echo off
setlocal EnableDelayedExpansion
set a1=A
set a2=B
set a3=C
set a4=D
set a5=E
for /f "tokens=*" %%i in (test.txt) do (
set /a b+=1
call echo %%a!b!%%
)
pause
| 欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/) | Powered by Discuz! 2.5 |