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
  • 25,661
  • 5
  • 43
  • 71
Adi
  • 71
  • 1
  • 4
  • 11
  • 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
  • 31,767
  • 12
  • 51
  • 89
Adi
  • 71
  • 1
  • 4
  • 11
  • 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