I have a batch file that is copying data from a source folder to a destination folder. A text file called list.txt decides which folders from the source folder will be copied to the dest folder. The contents of the text file, list.txt, are:
F:\200208
F:\200210
F:\200214
The batch file is:
@echo off
for /f "tokens=*" %%i in (list.txt) do (
xcopy /s /i "%%i" "D:\username\Videos\%%i"
)
pause
However, when I run the batch file, I get the following error messages:
Invalid path
0 File(s) copied
Invalid path
0 File(s) copied
Invalid path
0 File(s) copied
Press any key to continue . . .
The name of the drive in which this batch file is residing is F and folders with name 200208, 200210 & 200214 do exist in that same drive F. Also, the dest folder exists.
Can someone point out where the issue is?
ECHOat the beginning of the line inside your loop so you can can see the problem. It would look likeECHO xcopy /s /i "%%i" "D:\username\Videos\%%i". - aphoria