Hello,
I am trying to create a batch file to copy files from a list of locations in a .txt file to a new location.
The code below gives me an error, because the files have spaces in the names.
@echo off
echo -- > C:\TestingTMP.txt
xcopy /y C:\Testing.m3u C:\TestingTMP.txt
find "H:\Music" C:\TestingTMP.txt >> C:\Testing.txt
for /f %%a in (C:\Testing.txt) do (
xcopy /y %%a H:\Music\Testing
)
"Testing.txt":
H:\Music\Kutless\Kutless - Sea Of Faces.mp3
H:\Music\Tree 63\The Life And Times Of Absolute - Tree 63 - How Did I Sleep.mp3
etc.
Using a third party program (because all the forums indicate this is what it will take to do text find and replace), I have changed the list generated in "Testing.txt" and put inverted comma's around the files with spaces.
H:\"Music"\"Kutless"\"Kutless - Sea Of Faces".mp3
H:\"Music"\"Tree 63"\"The Life And Times Of Absolute - Tree 63 - How Did I Sleep".mp3
etc.
Now the code
for /f %%a in (C:\Testing.txt) do (
xcopy /y %%a H:\Music\Testing
gives me a "Parse Error"! And it still only looks at the title before the first space!
eg.
c:\>(xcopy /y H:\"Music"\"Kutless"\"Kutless - Sea H:\Music\Testing
Parse Error
Can anyone please shed some light on this supposed to be simple function and how to solve the problem?
Configuration: Windows Vista Internet Explorer 7.0