At which point does `forfiles` enumerate a directory (tree)?
问题 The command forfiles is intended to enumerate a directory and apply (a) certain command(s) on each item. With the /S the same can be accomplished for a full directory tree. What happens when the content of the enumerated directory (tree) is changed by the command(s) in the body of the forfiles command? Supposed we have the directory D:\data with the following content: file1.txt file2.txt file3.txt The output of forfiles /P "D:\data" /M "*.txt" /C "cmd /C echo @file" when executed in said