I've looked through the many batch-from-a-list topics on here, but haven't found anything on point. I have a text file with a list of files, including paths. I need to first copy these files out to an external drive, then delete the original files from the system drive. The batch file below works, with one glitch: I need to recreate the folder structure when the files are copied to the external drive. For example, if the file of interest is C:\foo\foo.txt, I need it to copy to a \foo directory on the external drive. I thought I had the xcopy parameters set to do that, but it's simply copying everything into one folder.
Next, I'd like to have some error handling in the batch file, in case some files aren't present.
Thanks a million for any help! Here's what I have so far...
@echo offfor /f "tokens=* delims=" %%a in ('type "D:\files.txt"') do xcopy /shrkvy "%%a" "D:\Reclamation"echo All files copied to reclamation folder.@echo offfor /f "tokens=* delims=" %%a in ('type "D:\files.txt"') do del "%%a"echo All files deleted from device.pause