Solved Batch- copy FOLDERS listed in txt file

September 10, 2012 at 08:10:28
Specs: Windows XP
Hi all,
I have a notepad file with a list of folder names. what i need is a batch file that will read from the text file and copy the folders (with subfolders and files) to a different directory.

The txt file will have the names of the folders listed.

for example

Folders are located here: C:\source
Folders should be copied here: C:\destination
Which folders exactly needs to be copied stands in the txt.


See More: Batch- copy FOLDERS listed in txt file

Report •


#1
September 10, 2012 at 11:41:52
There is a switch /EXCLUDE in XCOPY, which will allow you exclude files/directories listed in a file you pass to it.
XCOPY source destination /EXCLUDE:file

Of course you will have to edit the "file" to list things you DON'T want to be copied.


Report •

#2
September 10, 2012 at 17:07:56
✔ Best Answer
@for /f %%a in (copyjob.txt) do xcopy /e /i c:\source\"%%a" c:\destination\"%%a"

Report •

#3
September 11, 2012 at 02:19:20
@nbrane - Thanks !!!

Report •

Related Solutions


Ask Question