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

massaki picture massaki · Jul 22, 2011 · Viewed 35.5k times · Source

I have a txt file with the full path for .jpg files, I need to xcopy the whole folders including everything inside using xcopy using batch file

Answer

Michael picture Michael · Jul 8, 2016

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