我得到了1.txt和2.txt在我的工作目錄中。我使用下面的批處理來列出所有文件。關於windows批處理文件的奇怪問題
批次是這樣的:
@echo off
for /f "tokens=*" %%a in ('dir *.txt /b') do (
echo ---------------
set file_variable=%%a
echo file_variable=%file_variable%
echo filename=%%a
)
結果如下:
---------------
file_variable=2.txt <---------------why it is not 1.txt here??
filename=1.txt
---------------
file_variable=2.txt
filename=2.txt
感謝。
謝謝,修復它。 – smwikipedia 2011-03-18 08:05:52