Windows 7 Batch Script 'For' Command Error/Bug
问题 There seems to be a bug with the Windows 7 batch file 'for' command. This command can walk through a source directory and return one filename at a time. But I found that if my command modify the files in that source directory e.g. for /R %1 %%s in (*.*) do call :do1file %%s @goto :EOF :do1file @echo es > tmp_x2932.tmp move /y tmp_x2932.tmp %1 @goto :EOF the 'for' command could invoke the do command with the same file name more than 1 times. (Note that, for the purpose of illustrating the