CMD Command to Copy files with certain extension

cmd

Solution

Add quotes just around the variable after the copy command:

for /R c:\source %%f in (*.xml) do copy "%%f" x:\destination\

Problem

So I'm using this command to copy only txt files from a certain directory to another directory ``` for /R c:\source %%f in (*.xml) do copy %%f x:\destination\ ``` But it only copies over the text files without a space in the name, so it copies test.txt but not test 2.txt. How do I make it so it copies txt files with spaces?

Original source