I think there is an inconsistency - if not an actual contradiction - in the documentation of the FileCopyDir command. It appears to say both that it WILL and WILL NOT recurse through a folder structure. See pasted text below, with my bold emphasis. Please let me know if I am missing something subtle. Otherwise might it be amended?
Thanks.
Remarks
If the destination directory structure doesn't exist it will be created if possible.
Since the operation will recursively copy a folder along with all its subfolders and files, the result of copying a folder to a destination somewhere inside itself is undefined. To work around this, first copy it to a destination outside itself, then use FileMoveDir to move that copy to the desired location.
FileCopyDir copies a single folder. To instead copy the contents of a folder (all its files and subfolders), see the examples section of FileCopy.
Inconsistency in FileCopyDir documentation
Re: Inconsistency in FileCopyDir documentation
I think you are misunderstanding the docs. You have to distinguish between a folder and its contents.
At first, we learn:
FileCopyDir recurses (if possible - if it doesn't lead to undefined behaviour).
It accepts only a single source folder.
Copy (the whole) folder x versus enter folder x and copy all its contents, that means, all files and folders inside folder x.
Do you see the difference between FileCopyDir and the FileCopy example #2 ? This is what the last sentence in the remarks section is about, that difference.
Btw, the so-called Filecopy example also uses FileCopyDir itself to copy any folders it finds (again, with recursion, if possible).
At first, we learn:
FileCopyDir recurses (if possible - if it doesn't lead to undefined behaviour).
It accepts only a single source folder.
The last line has a different focus: FileCopyDir copies one folder (that it recurses while doing that, we already know, it was already mentioned twice; this is its normal behaviour), but if you just want to copy all the contents of that folder (all files and folders), not the folder itself, then use that FileCopy example instead.https://www.autohotkey.com/docs/commands/FileCopyDir.htm#Remarks wrote:FileCopyDir copies a single folder. To instead copy the contents of a folder (all its files and subfolders), see the examples section of FileCopy.
Copy (the whole) folder x versus enter folder x and copy all its contents, that means, all files and folders inside folder x.
Do you see the difference between FileCopyDir and the FileCopy example #2 ? This is what the last sentence in the remarks section is about, that difference.
Btw, the so-called Filecopy example also uses FileCopyDir itself to copy any folders it finds (again, with recursion, if possible).