Not sure if this is considered a bug or miss use, but I didn’t see any mention for trailing backslashes in the command info page so …
When passing a path with a trailing backslash “\” in the
DestPath for Copy/CopyTo command, I get a notice message and a new directory is created, which is named as the Dest directory but with an Underscore at the end.
copy "GD:/Files/Tools/file.txt" "E:\Files\Tools\"
NOTICE: Local file system at : Replacing invalid characters in "\\Files\\Tools\"" to "\\\\?\\E:\\Files\\Tools_"
This also means that you can’t copy to the root of the drive since it can’t create the new directory. e.g:
NOTICE: Local file system at \\?\E:\: Replacing invalid characters in "\\\"" to "\\\\?\\E:\\_" ERROR : file.txt: Failed to copy: mkdir \\?: The filename, directory name, or volume label syntax is incorrect.