21

I am trying to copy files from a corrupted hard drive. Not all of them will copy - some have CRC errors and will stall. I would like to skip those files and continue with the rest of the copy - but the copy process stops until I click one of the options in the error window. Is there a way for me to copy everything, tell the OS to suppress that prompt and just not copy the corrupted files?

This is on Windows 7.

6 Answers 6

20

The fastest way would likely to be to use xcopy through a Command Prompt instance, in a context similar to:

xcopy $SOURCE $DESTINATION /C /E /Q 

The /C flag forces xcopy to ignore any issues with copying; the /E flag orders xcopy to copy folders (even empty ones), and the /Q flag makes it a quiet operation (otherwise, you'll get an entry for each thing copied).

An example would be:

xcopy d:\*.* c:\recovery /C /E /Q
5
  • why not cp ?? Apr 25, 2012 at 7:37
  • 3
    @VineetMenon Assuming that you mean the copy command, that's because it doesn't have the "continue in spite of errors" nature that the questioner is asking for. If you mean the Linux command cp, that's because the question is related to Windows 7. Apr 25, 2012 at 7:39
  • ooh...I meant cp as in Windows, didn't knew about non-error ignoring capabilities!! :( thx Apr 25, 2012 at 8:43
  • it skips the files with read errors instead of copying them as much as possible Apr 24, 2021 at 17:24
  • 2
    This failed with an Insufficient memory error, apparently due to a path longer than 254 characters. If you are going to run this command, change the /Q to /F so you can see the progress, and add /H to include hidden/system files. Jun 4, 2021 at 20:38
8
 robocopy.exe with /r:0 /w:0 

for a first pass, then increase to /r:1

3
  • Robocopy is part of the "Windows Server 2003 Resource Kit Tools" which you can download here: microsoft.com/download/en/details.aspx?id=17657
    – LawrenceC
    Apr 25, 2012 at 13:40
  • 3
    Yes, but it's also part of Windows 7
    – fstx
    Apr 27, 2012 at 7:48
  • it skips the files with read errors instead of copying them as much as possible Apr 24, 2021 at 17:24
4

The xcopy option will fail with an "Insufficient space" error. See this link for example:

http://en.wikipedia.org/wiki/XCOPY#Limitation

I tried xcopy first as the user suggested but then I used robocopy which is included in Windows 7 and this one succeeded:

robocopy source destination /E

The /E is to recursively with empty directories.

http://en.wikipedia.org/wiki/Robocopy#Common_usage_scenarios

1
  • You must also add /R:0 to robocopy, otherwise it will retry 1 million times on an error. Jun 4, 2021 at 21:38
3

Maybe some simple Powershell snippet?

copy-item -path E:\myfolders -destination C:\newfolder -container -force -recurse -erroraction continue -warningaction continue -confirm:$false

In order to run, open Powershell console (available in every Windows since XP), change -path and -directory parameters to your start and destination folder, copy the command to PS window and press enter. If you can't copy, enable quick edit mode in console properties - this maps paste option under right-mouse button in Win7.

Might require closing paths in quotation marks '' if there are special signs in names, like whitespace.

This run in Powershell should copy all files and subirectories to specified directory. Will continue copying despite some error with specified file. For every broken file that command can't copy, you will receive a lot of red output in console. If you don't want to see these, change erroraction to silentlycontinue.

2

In the past, I've used TeraCopy. Another option would be a block-level copy--for example, using dd or a disk cloning utility. Personally, I would boot from a live Linux CD and use dd_rescue/ddrescue if the data is important.

2

I came across "Roadkil's Unstoppable Copier". It has as graphic interface and was designed specially for those cases.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.