5

A file syncing software ran out of control and removed most of my personal files. Luckily they were found in the recycle bin. Now the problem is I can't restore them because there's too many (30,000+) files to restore.

When I clicked on the "restore all items" button, explorer freezed for a while, and after that a popup window said "preparing to move files" showed up and hanged at "0 item found".

I tried to restore five pages of file (approximately 100) at a time and that attempt succeeded. But it's impossible for me to manually restore that many.

I have permanently deleted all recycle bin items which were already in there before the accident, so every file is unique now and there's no risk of duplicates interrupting the process if I run a batch or something. Actually I can try to write a program myself, maybe there's reference to this on StackOverflow, but I can't risk destroying the files completely, so that's not the option, at least not for now.

Any ideas? Thanks in advance.

1
  • I did a silly thing and deduplicated a whole drive, removing some identical project files that are needed to open various projects. After my 8GB RAM machine chrashed a few times recovering files from Trash, I ran Recuva and it found 250k trashed files in 10s and scanned the disk and found 1.5M deleted files in about 20 minutes (USB spinning HDD). RAM use is around 2.5GB., Aug 20, 2020 at 18:03

2 Answers 2

1

This method should get all of the files out of the Recycle bin, but be aware you will have to put them back where they belong yourself if you need them to be in a specific directory.

1.) Open command prompt as administrator, run the command wmic useraccount get name,sid, copy the SID for your user, now in the same command prompt run cd \$Recycle.Bin\%SID% replacing SID with the SID you just copied to your clipboard (but leave the % on either side there, it is a hidden folder and requires those be left in the name).

2.) Now copy everything in that folder to an empty folder of your choice with xcopy /e .\* C:\path\to\your\empty\folder\ but be warned, this will copy all 30000 files via the command prompt and will likely take a while. After it is done, check the command prompt to make sure no errors were thrown, and check the folder you copied everything to and make sure it's all there. You should now be free to empty your recycling bin safely.

4
  • this just replaces one folder with another to sort out, where's the gain in that?
    – ths
    Feb 27, 2017 at 12:40
  • that's kind of useless, unless I can get a key-value dictionary of all removed files' current names and actual paths through some Windows API and then I can restore them automatically... or I'd rather choose to roll back to the latest backup... Feb 27, 2017 at 13:04
  • @ths the issue was not sorting the folder, it was getting them out of the trash whatsoever. As far as the answer not helping you, sorry but I don't know another way you could retrieve them when explorer literally claims nothing is there. I figured based on the way you phrased it that you were trying to perform an emergency recovery of files you had no other way to preserve. If you have a backup containing them and the option to roll back to it I honestly can't see a reason not to just do that rather that trying to manually salvage 30000 files that explorer thinks don't exist. Feb 27, 2017 at 13:10
  • @AlisonE.E. I don't want to lose the changes made after the backup and for some reason retrieving 30000 files from the backup server is also hard (that would at least take 2 days due to the poor connectivity, and can't be undone because I'm running out of space and have to delete them first)... I'm going to give it a try, I have already found some reference to interacting with the Recycler through COM. Thanks anyway. Feb 27, 2017 at 13:39
1

I finally found out how to deal with this problem, using C#.

Sorry for not providing a compiled version, but this code is language-specific (windows-version-specific too), and is intented to be used by people who understand it only.

Here's the code hosted on Gist.

It runs really slow... but the good thing is it works. Better than nothing. I have time to wait.

Reference:

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .