Does anyone know if it is possible to create a batch file that will use xcopy but only search in a given set of directories, and all levels below it, as specified in a text file (i.e. the list could be updated without having to recode the .bat file)?
In case this isn't clear, the text file might look like:
c:\test\
c:\test1\
c:\test2\
Just checking!
Thanks =)
Copy files from text list?
Moderator: DosItHelp
-
- Expert
- Posts: 442
- Joined: 01 Aug 2010 17:13
- Location: Canadian Pacific
- Contact:
Re: Copy files from text list?
Something like...
Set your own xcopy switches. xcopy /?
Code: Select all
set "destination=C:\whereever"
for /f "tokens=*" %%x in (folders.txt) do xcopy "%%x" "%destination%"
Set your own xcopy switches. xcopy /?