Bug: Duplicate finder keeps showing deleted duplicates in Recycle bin

Discussion related to "Everything" 1.5 Alpha.
Post Reply
Raindrops
Posts: 247
Joined: Sat Jan 21, 2023 10:04 am

Bug: Duplicate finder keeps showing deleted duplicates in Recycle bin

Post by Raindrops »

I right-clicked on Size column and selected Find size duplicates.

After that, I deleted some of the duplicates.
I expected the surviving non-duplicate file also to drop out of display because it does not have any duplicates now.
But the deleted files reappear in the list with a name that begins with $, and with a path that shows the Recycle Bin.

Thus, the deleted entries are not cleaned up from the list. [BUG]
Phlashman
Posts: 41
Joined: Sun Sep 11, 2022 4:57 am

Re: Bug: Duplicate finder keeps showing deleted duplicates in Recycle bin

Post by Phlashman »

Add to your Index/Exclude/Exclude Folders the "Add Filter" entry below. The ?: part will exclude the Recycle bin from A:..Z: drives

?:\$recycle.bin\

This should remove entries in your Recycle bin(s) from your searches
Last edited by Phlashman on Wed Feb 08, 2023 8:50 am, edited 3 times in total.
harryray2
Posts: 1104
Joined: Sat Oct 15, 2016 9:56 am

Re: Bug: Duplicate finder keeps showing deleted duplicates in Recycle bin

Post by harryray2 »

Try !\$recycle.bin\
Raindrops
Posts: 247
Joined: Sat Jan 21, 2023 10:04 am

Re: Bug: Duplicate finder keeps showing deleted duplicates in Recycle bin

Post by Raindrops »

I found that the Exclude dialog does not allow us to add the Recycle bin as an excluded folder.
Exclude dialog.png
Exclude dialog.png (29.89 KiB) Viewed 3370 times
So I added a Filter, and then pasted the condition ?:\$recycle.bin\
This seems to work.

Can someone explain the syntax of this command - What is the significance of ? and : ?
Thanks in advance!
harryray2
Posts: 1104
Joined: Sat Oct 15, 2016 9:56 am

Re: Bug: Duplicate finder keeps showing deleted duplicates in Recycle bin

Post by harryray2 »

I have c:\$recycle.bin in my exclusion list, which works.

I haven't tried ?: in my exclusion list, but on the normal Everything search window it doesn't appear to do anything
harryray2
Posts: 1104
Joined: Sat Oct 15, 2016 9:56 am

Re: Bug: Duplicate finder keeps showing deleted duplicates in Recycle bin

Post by harryray2 »

Also, ticking the exclude system files and folders should work, but obviously no good if one doesn't want to hide system files.
void
Developer
Posts: 16764
Joined: Fri Oct 16, 2009 11:31 pm

Re: Bug: Duplicate finder keeps showing deleted duplicates in Recycle bin

Post by void »

Everything sees the recycle bin as a normal folder.
Deleting a file will move the file to the recycle bin folder.
The files still appear as duplicated to Everything.



I recommend using omit results to hide Recycle bin results.

Omit results can be toggled instantly.
Changing excludes requires a reindex.
Everything can miss changes if you exclude the recycle bin and restore a file/folder.



To add all recycle bin folders to your result omissions:
  • In Everything, from the Index menu, check Omit Results.
  • From the Index menu, click Organize result omissions....
  • Click Add Filter....
  • Check Omit folders.
  • Change the filter to:
    ?:\$recycle.bin
  • Click OK.


Files can be permanently deleted with Shift + Delete.
Permanently deleted files will not be moved to the recycle bin and cannot be undeleted.


I found that the Exclude dialog does not allow us to add the Recycle bin as an excluded folder.
The recycle bin folder cannot be selected with the Browse for folder dialog if the system folder setting "Hide protected operating system files" is enabled.
There's no way to override this setting from Everything.
You'll need to manually type in the recycle bin folder:
C:\$recycle.bin


Can someone explain the syntax of this command - What is the significance of ? and : ?
All filename filters in Everything support wildcards (?, * and **):
? = match a single character (except \)
* = match any character (except \) any number of times.
** = match any character any number of times.

: will match a literal :

The following filter will match the recycle bin folder on any drive:
?:\$recycle.bin

?:\$recycle.bin matches c:\$recycle.bin, d:\$recycle.bin, e:\$recycle.bin, etc...
Raindrops
Posts: 247
Joined: Sat Jan 21, 2023 10:04 am

Re: Bug: Duplicate finder keeps showing deleted duplicates in Recycle bin

Post by Raindrops »

And does the $ prefix mean "hidden" or "system"?
void
Developer
Posts: 16764
Joined: Fri Oct 16, 2009 11:31 pm

Re: Bug: Duplicate finder keeps showing deleted duplicates in Recycle bin

Post by void »

$ doesn't mean anything special.

$ in the filter matches a literal $

For whatever reason, the recycle bin is physically stored in C:\$Recycle.bin on NTFS file systems.

The $ prefix here could mean system.
Most likely from the fact that all internal system NTFS files are prefixed with $
For example: $MFT is the name of the Master File Table file.

There's nothing stopping you from naming a folder with a $ prefix.
The $ prefix doesn't flag the folder as system.

It's the SYSTEM attribute on the C:\$Recycle.bin folder that makes it a system folder.
raccoon
Posts: 1017
Joined: Thu Oct 18, 2018 1:24 am

Re: Bug: Duplicate finder keeps showing deleted duplicates in Recycle bin

Post by raccoon »

In the case of the recycle bin, it's just Microsoft being silly and adding its own dollar sign symbol. NTFS layer doesn't recognize this folder directly.
The recycle bin folder has been variously named $Recycle.Bin, $RECYCLE.BIN, RECYCLER, and RECYCLED. If your drive (or VeraCrypt Mount) has the Removable Media Bit (RMB = 1) then no $Recycle.Bin folder will be created at all and files are deleted directly/permanently.

Summarizing above responses:

This goes into the Options > Indexes > Exclude
?:\$Recycle.Bin
Or this can be added to your regular Search terms.
!\$Recycle.Bin
Raindrops
Posts: 247
Joined: Sat Jan 21, 2023 10:04 am

Re: Bug: Duplicate finder keeps showing deleted duplicates in Recycle bin

Post by Raindrops »

Thanks indeed for the clarification and tips!
Raindrops
Posts: 247
Joined: Sat Jan 21, 2023 10:04 am

Re: Bug: Duplicate finder keeps showing deleted duplicates in Recycle bin

Post by Raindrops »

BTW I imagined that there is only one Recycle Bin, because-
1. There is a single icon on Desktop.
2. We empty that single Recycle Bin every time. We do not empty multiple bins.
3. When I delete anything from external HDD, the item disappears, and there is no way to retrieve it.
(Even when I do NOT press SHFT+DEL)

BTW is it one bin per HDD or one bin per each logical partition?
raccoon
Posts: 1017
Joined: Thu Oct 18, 2018 1:24 am

Re: Bug: Duplicate finder keeps showing deleted duplicates in Recycle bin

Post by raccoon »

Raindrops wrote: Wed Feb 08, 2023 4:14 pm BTW I imagined that there is only one Recycle Bin, because-
1. There is a single icon on Desktop.
2. We empty that single Recycle Bin every time. We do not empty multiple bins.
3. When I delete anything from external HDD, the item disappears, and there is no way to retrieve it.
(Even when I do NOT press SHFT+DEL)

BTW is it one bin per HDD or one bin per each logical partition?
1. There is a single Desktop icon, but it is used to indicate trash in any of the recycle.bin/recycler/recycled folders on any of your drives. Each drive has its own recycle.bin folder and files that you delete are simply moved (path renamed) into that drive's recycle.bin. No actual file transfer takes place otherwise deleting gigabytes of files would have to move them to your C: drive, which might take hours. Instead it's a simple bulk rename operation.

2. When you empty the Recycle Bin desktop icon, it empties all of the recycle.bin folders on all of your drives. Win32API functions exist for emptying on a per-volume basis, but this is not implemented anywhere on the Windows desktop. (It can be done from AutoHotkey scripts.)

3. Either your external HDD's firmware reports the Removable Media Bit (RMB=1) flag, which normally prevents deleted files from being moved to a recycle.bin folder, or your system is configured this way. Typically only USB flash thumbdrives have the RMB=1 (Removable Disk) flag, while spinning platter and SSD external USB drives have the RMB=0 flag (Local Disk), but there's no rule against an external harddrive from having the RMB=1 (Removable Disk) flag set in their firmware. When mounting encrypted disks with VeraCrypt/TrueCrypt, you can select which RMB you want set for each mounted volume. You can Google for how to Enable Recycle Bin for Removable Drives, which might be a new Windows 10/11 feature.

It's one bin per each volume, ie, logical partition or drive letter. So that files are not moved between volume drive letters, as explained above, only each deleted object's path is quickly renamed.

On FAT drives, the folder name is RECYCLED. On NTFS drives in Windows XP (and Vista?) the folder was named RECYCLER.
Post Reply