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.
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
for /r "D:\Dokumenty\" %%# in (*.txt) do copy /y "%%~f#" "D:\final"
Robocopy will often be much faster than a regular copy - especially if you run it with the /mt switch.