批处理开启变量延迟,FOR语句中嵌套IF不能正常执行其后的代码
@echooffsetlocalEnableDelayedExpansionfor/f"tokens=1"%%ain(1.txt)do(setaa=%%a&for/f"t...
@echo off
setlocal EnableDelayedExpansion
for /f "tokens=1" %%a in (1.txt) do (set aa=%%a & for /f "tokens=1" %%a in (2.txt) do (if !aa!==%%a echo success))
pause
不能正常显示SUCCESS 展开
setlocal EnableDelayedExpansion
for /f "tokens=1" %%a in (1.txt) do (set aa=%%a & for /f "tokens=1" %%a in (2.txt) do (if !aa!==%%a echo success))
pause
不能正常显示SUCCESS 展开
1个回答
2013-10-30
展开全部
@echo off
setlocal EnableDelayedExpansion
for /f %%a in (1.txt) do (set aa=%%a
for /f %%i in (2.txt) do (if !aa!==%%i echo success)
)
pause
setlocal EnableDelayedExpansion
for /f %%a in (1.txt) do (set aa=%%a
for /f %%i in (2.txt) do (if !aa!==%%i echo success)
)
pause
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询