0

I have an hard disk that is going bad. I plan to list the files and folders using the dir command, then select specific files and folders and put them in a text file and run the xcopy/copy command to copy them to another folder.

What would be the best way to do this? The full paths of the files and folders are in file named backup.txt.

Mark
  • 3,609
  • 1
  • 22
  • 33
user1955215
  • 733
  • 2
  • 11
  • 31
  • 1
    possible duplicate of [How do I copy file and folder structure using xcopy from a text file?](http://stackoverflow.com/questions/14457876/how-do-i-copy-file-and-folder-structure-using-xcopy-from-a-text-file) – Ken White Jan 14 '14 at 17:52
  • Assuming this is the file name in the text file:"G:\MP3 Favourites\01 natrang\01 Natrang - Natrang Ubha.mp3" The code in the linked resource:@echo off for /f "delims=" %%A in (copytest.txt) do if exist "%%~fA\*" ( md "G:\MP3 Favourites\test\%%~pA" copy /y "%%~fA" "G:\MP3 Favourites\test\%%~pnxA" ) -- is not working (not copying any files to the test subfolderin – user1955215 Jan 14 '14 at 18:24
  • The information you need is in the post I linked. It's not "copy and paste and run it", but it has every piece of the information available. You can do the minimal work to convert it to do what you need, I think; we're not a code writing service. Change the `xcopy` in the `for` loop in that code to `echo` for testing, and make an effort to figure out how to make it work to do what you need. If you can't, then you'll at least have an effort you can post back here and a specific problem you can ask about that we can help you solve. – Ken White Jan 14 '14 at 18:29

0 Answers0