xcopy all folders and subfolders from txt(with paths , and spaces )

36,896

Solution 1

This is an old question, but I had the same question and neither of the above answers quite did it for me. I had to add /s:

xcopy C:\path\to\source\directory D:\path\to\destination\ /e /i /y /s

That copys all files, subfolders, and files in subfolders. More (and helpful) documentation available here:

https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/xcopy

Solution 2

xcopy /? will show you the options you can use. You probably want something like xcopy C:\path\to\source\directory D:\path\to\destination\ /e /i /y

Solution 3

Something like this should do it

FOR /F "delims=" %%i IN (c:\temp\paths.txt) DO xcopy "%%i*.jpg" "C:\test\" /s /y
Share:
36,896
massaki
Author by

massaki

Updated on March 28, 2020

Comments