3
我在这里有一个问题。第一 第一件事,代码:批处理文件,For循环不回应线
test.bat的内容:
@echo off
cls
for /F "delims=" %%a in ('dir /B /A-D ^| findstr /I ".txt$"') do (
set str=%%a
echo %str% >> list.tmp
pause
)
echo ------------------
for /F %%i in (list.tmp) do echo %%i
del list.tmp
echo ------------------
在test.bat的是同一个目录中,有两个测试文件: 的1.txt和2.txt
当我运行test.bat的,我的输出是:
------------------
2.txt
2.txt
------------------
正如你所看到的,未列出的1.txt。
并添加3.txt时,输出为:
------------------
3.txt
3.txt
3.txt
------------------
谁能帮我请?
感谢, 黄灏玄