Bug: The line
Code: Select all
Loop, %SourcePattern%, 2 ; 2 means "retrieve folders only".
Code: Select all
Loop, Files, %SourcePattern%, 2 ; 2 means "retrieve folders only".
Code: Select all
CopyFilesAndFolders(SourcePattern, DestinationFolder, DoOverwrite = false)
Finally, since the pattern used in the example is *.*, the entire example could have been performed by a single FileCopyDir call and is therefore of little interest. Rather, since FileCopyDir lacks a file pattern parameter (unlike XCopy and RoboCopy), the example function could with very few changes be made recursive rather than use FileCopyDir to achieve a directory copy function with a file pattern feature, thus plugging the hole in the FileCopyDir functionality.
JB