Good morning. I'm hoping someone here can help me out. By way of preface, I'm no expert in scripting, and I'm not a programmer. Nor am I in a class trying to get an answer to a question for free.
I'm in Litigation Technology and have a situation that I've run into before. I've done quite of bit of research into it and thought I had a solution, but could use a bit of assistance.
I'm trying to use an xcopy.bat to copy a specific list of files to a new drive keeping the folder structure intact. It is working very well except for one minor exception. I seem to be getting one extra folder at the end of each copy which is the file name itself.
For example, my list is:
Folder1\docIneedcopied.doc
Folder1\doc2needingcopy.xls
Folder1\MyFiles\another file I need.doc
I am getting for a result in the new drive:
Folder1\docIneedcopied\docIneedcopied.doc
Folder1\doc2needingcopy\doc2needingcopy.xls
Folder1\MyFiles\another file I need\another file I need.doc
The script I have for the bat is:
for /f "delims=" %%i in (filelist.txt) do echo D|xcopy "C:\%%i" "E:\%%i" /i /z /y
Can anyone advise where I've gone wrong in this script or is that just the way it works?
I also have Robocopy, but couldn't get that script to work at all.
Any other advice or ideas (keeping in mind I'm a learning-in-progress!) would be very much appreciated.
Cheers,
L. Burr