Reputation: 55
I'm trying to copy several files from several folders into 1 folder with this code:
for /R \\wiki\help\images %%f in (*.jpg, *.png, *.gif) do (
copy %%f "\\10.101.3.21\wikitest\wiki\wikiimages"
)
However, it copies all the files as wikiimages, and I can't get around it. I just want to use the copy command, not an external program (so no xcopy
or the like). How can I do this?
Upvotes: 0
Views: 170
Reputation: 82
I'm pretty sure
for /R \wiki\help\images %%f in (*.jpg, *.png, *.gif) do copy %%f "\10.101.3.21\wikitest\wiki\wikiimages\"
is the way to fix this, it usually need the \ to know its a folder and not a filename.
Upvotes: 1