How to get rid of The file cannot be copied onto itself.
Posted: 09 Jun 2022 13:05
Hi ALl,
I have a below code to copy all subfolders files to one newly made subfolder.
folder/
.......
It works fine except in the middle having these lines
The file cannot be copied onto itself.
0 file(s) copied.
How can I get rid of these lines?
Thanks
I have a below code to copy all subfolders files to one newly made subfolder.
folder/
.......
Code: Select all
for /r "folder" %%d in (*) do copy "%%d" "folder\subfolder"
The file cannot be copied onto itself.
0 file(s) copied.
How can I get rid of these lines?
Thanks