Reputation: 339
I need copy lot of *.txt file from multiple folders to one.
I try use for exp.:
xcopy D:\Dokumenty\*.txt D:\final /sy
But this make 1:1 copy of folder. I need copy only files to a new folder.
Thanks for help.
Upvotes: 2
Views: 4994
Reputation: 2710
You can also use wildcard (?*
) in ROBOCOPY
usage: ROBOCOPY source destination [file [file]...] [options]
Transposing your example should look like this:
ROBOCOPY "D:\Dokumenty\" "D:\final" *.txt /S
Upvotes: 3
Reputation: 57242
for /r "D:\Dokumenty\" %%# in (*.txt) do copy /y "%%~f#" "D:\final"
Upvotes: 2