Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Restoring "$Recycle.bin" files  RSS feed

 
john price
Ranch Hand
Posts: 495
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I made a hard drive scanner. It scans the contents of the hard drive and spits out all the names in a file. When I looked at the list, I found thousands of results such as these :

Anyway, I'm 99% sure that these are the files that have the "on" tag for deletion. What this means is that I could now recover my own files! I could build a program that could search for "C:\$Recycle.Bin" and get all the file names. My question to you guys would be the best way to pick the wanted files up. Should I copy the files (bytes) to create a new one with the same name in a specific location? Should I try to go into the files and set the flag to "off"? If you guys have any experience with this, please share! This could have helped me yesterday when I deleted a very much needed file. I sadly couldn't recover it. I don't know exactly where this question goes (maybe in the "General Java" section?), but it's related to IO, so I posted it here.
 
Rob Spoor
Sheriff
Posts: 21088
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
john price wrote:This could have helped me yesterday when I deleted a very much needed file. I sadly couldn't recover it.

If the file is in the recycle bin like this then you should be able to recover then from the Windows recycle bin. That's also the way to go.

You could try to recover the file by just copying, but the results won't be guaranteed. In fact, the way recycle bin files are stored on your system are different from the way recycle bin files are stored on my system (Windows 7 64 bit). Here, files are stored directly inside the S-1-5-21 folders with garbled up names.
 
john price
Ranch Hand
Posts: 495
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please note that these files are NOT in the "Recycle Bin" in Windows. These are files marked with the flag to be overwritten. I'm pretty sure the "flag" is a character Windows places on the program or in the program to set it's flag to "on". If any of you have experience with this, please don't hesitate to share. There ARE file recovery programs out there. I just want to do it myself.
Thanks,
John Price
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!