4

Recently, due to a runaway process, some 1.4 milion small files (around 8 Kb) were generated and moved to Recycle-Bin. What would be a convenient way to restore some of the files and permanently delete the others without killing the system? For example, I need to permanently delete all files that contain a specific string from the original filename and restore others. Opening Recycle Bin causes the memory to fill up and the machine becomes unresponsive.

EDIT: This is a virtual machine that runs as a server.

  • Can you add more memory to the PC so it does not lock up? – Moab Feb 24 at 15:06
2

I'd start by shutting down the machine & getting the drive out. Don't handle it in a 'live' environment, as the OS might get 'smart' & start clearing files above the Trash limit set by the user.

idk how you'd batch script the actual recovery, so I'll leave that to someone else, but once out of the live OS, the Trash is just a folder like any other.

| improve this answer | |
  • Not entirely true. Yes, all files deleted are stored in C:\$RECYCLE.BIN, but their filenames and locations are unsure. It is not going to be as easy to restore this. It is a good idea to backup the disk before attempting anything, but I don't think a live environment is going to be of much help here. – LPChip Feb 24 at 15:28
  • 1
    I already said first step is to get it away from the live OS. If the OS thinks it's dealing with its own trash it will do what it feels like with it. Once out of there, it's less likely to be further damaged. Windows has always had a horrible 'smart purge' which other OSes don't. – Tetsujin Feb 24 at 15:31
  • @SamForbis - Windows has always had an allocation for how much space it's allowed to use. For many years, your average user would never touch inside the recycle, just expect Windows to deal with it 'by magic'. It's still there in Win10, get properties on the recycle bin & see. – Tetsujin Feb 24 at 15:48
  • I realized that after I posted the comment, I guess I just never hit that limit or noticed it. – Sam Forbis Feb 24 at 15:53
0

I use the command line rd /s %systemdrive%\$Recycle.bin assuming the files are on the system (usually C:\ drive).

The drive letter can be added for other partitions, etc...

You can use wildcards to match specific files.

If you know what files you want to NOT delete (keep) then you could use the move command with wildcards to move them outside of the $Recycle.bin folder...

| improve this answer | |

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.