I have this code to copy files recursively from one folder to another.
set COMP_PATH=C:\Users\bose\Documents\test-download
cd C:\Users\bose\Desktop\downloaddir_nec
for /R %%f in (*.*) do copy /y %%f %COMP_PATH%
cd ..
This works fine as long as the folders I am recursing through don't have commas in them. I get this output when the folders have commas:
How do I fix this? I want to copy the contents of all folders, recursively.
Thank you.
Just put the path in double quotes.
set COMP_PATH=C:\Users\bose\Documents\test-download
cd C:\Users\bose\Desktop\downloaddir_nec
for /R %%f in (.) do copy /y "%%f" "%COMP_PATH%"
cd ..