Saved Bookmarks
| 1. |
Solve : copy files from csv list? |
|
Answer» HOLA, All I need to do is copy files with one or another extension, from many many different sub- directories in a root directory, to an OUTPUT directory. The list will be of the sub-directories to look in (I don't want files from all of the sub-directories) Any help appreciated. XP sp2 TimI'm not exactly sure what you mean, but this should GET you started I'll assume your "files with one or another extension" are GIVEN in a batch file variable I'll assume your "output directory" is given in a batch file variable I'll assume your CSV file list is named dirs.csv Code: [Select]@echo off setlocal set fileExtensions=.doc .xls set outputDir=D:\output for /f "delims=," %%a in (dirs.csv) do call :CopyFiles %%a goto :EOF :CopyFiles for %%b in (%fileExtensions%) do xcopy "%*\*.%%b" "%outputDir%\" goto :EOF |
|