0

I have a txt file that contains full paths of folders. I want to copy these folders to a new directory. For example, lets say that my txt file contains :

C:\tools\folderA
C:\tools\folderB
C:\temp\abc\folderC

I want to copy folderA, folderB, folderC to a new destination.
How can I do so?

JosefZ
  • 28,460
  • 5
  • 44
  • 83
Adi
  • 81
  • 3
  • 4
  • 12
  • There are [lots of similar questions](http://stackoverflow.com/search?q=batch+copy+folders+list) – wOxxOm Jul 28 '15 at 16:10
  • possible duplicate of [Batch: Copy a list (txt) of files](http://stackoverflow.com/questions/6257948/batch-copy-a-list-txt-of-files) – wOxxOm Jul 29 '15 at 02:42

1 Answers1

0
for /F "delims=," %%V in (.\myFolders.txt) do (
  xcopy /E /I "%%~V" "%outDir%\allFolders\%%~nV"
)
aschipfl
  • 33,626
  • 12
  • 54
  • 99
Adi
  • 81
  • 3
  • 4
  • 12
  • Good answers *explain* as well as provide code. Consider updating your answer to include an explanation about how this code works and why it is the best option. – Ajean Sep 02 '15 at 00:29