I have a text file which contains things like:
"C:\Folder A\Test.txt"
I need to copy certain files and their respective containers to a new directory from a directory, but only those files I specify and their parent folder structures.
In my batch:
for /f "delims=" %%a in (C:\audit\test.txt) do (
robocopy "%%~dpa" "Z:\" "%%~nxa" /E /COPY:DAT /PURGE /MIR /R:1000000 /W:30
)
pause
However, it fails the robocopy, probably to do with the trailing backslash. The Source gets mixed up and shows both the folder and the Z:. This means t he file name from %%~nxa
is then part of the destination rather than the file to copy. Any ideas?