If you have a CSV file (say, ‘filename.csv’) which has the list of the files location in any column(say, 2) and want to move those files in to folder (say, ‘DestinationFolder’) then you can achieve it by creating a batch file (say, ‘MoveFile.bat’) to do it.
Using any text editor type following DOS commands:
rem Moves files into Destination Folder
for /f “tokens=2 delims=,” %%a in (D:\filename.csv) do (
move %%~a D:\DestinationFolder
)
When you run the batch file
D:\>MoveFile.bat
Then it will iterate through the file location found in CSV file and move the file(s) to destination folder.
If you want to copy the file then use copy command.






Leave a Reply