Real Names in Pre-Vista Recycle Bin Prompts
Companion to Pre-Vista File Operation Dialogs: its XP-style prompts for deleting from the Recycle Bin show the file's real name instead of the internal $R name the Recycle Bin keeps it under
Author: appEW
Tested only on Windows 11 24H2 (build 26100). It has not been tried on any other version of Windows and may not work there.
Delete something out of the Recycle Bin with the XP-style prompts of
Pre-Vista File Operation Dialogs
enabled, and the confirmation asks about a file you never had:
Are you sure you want to delete "$RVAZ2WZ.b"?
This mod puts the real name back:


The stock Windows 11 prompt already shows the right name; the mod is for prompts
that look the name up the way Pre-Vista File Operation Dialogs does.
Why the name is wrong
The Recycle Bin does not keep a deleted file under its own name. It renames it
to $R plus a few random characters, keeping only the extension, and writes the
real path into a companion $I file next to it. Everything that asks the
Recycle Bin folder for a display name gets the original name back; anything that
only looks at the file on disk sees the stub.
The XP-style prompt looks at the file on disk: it asks SHGetFileInfo for the
display name of C:\$Recycle.Bin\<SID>\$RVAZ2WZ.b, and for a plain file path
that is just the file name - the stub.
What the mod does
When SHGetFileInfo is asked for the display name of a $R file inside a
$Recycle.Bin folder, the mod answers with the name recorded in the $I file
next to it - one small file read, no searching. With Show the full original
path on, it answers with the whole path the file was deleted from.
Anything else is passed straight through, and a $R file with no $I file next
to it keeps its own name.
Nothing about the Recycle Bin's contents, its folder view, or the files
themselves changes. This only changes the name a prompt is about to display.
По-русски
Если включён мод
Pre-Vista File Operation Dialogs
с запросами в стиле XP, то при удалении чего-нибудь из Корзины подтверждение
спрашивает об удалении файла, которого у вас никогда не было, - например,
«$RVAZ2WZ.b». Мод возвращает в такой запрос настоящее имя (скриншоты - выше, в
английской части). Стандартный запрос Windows 11 и так показывает правильное
имя; мод нужен для запросов, которые узнают имя так же, как Pre-Vista File
Operation Dialogs.
Корзина не хранит удалённый файл под его настоящим именем. Она переименовывает
его в $R и несколько случайных символов, сохраняя только расширение, а
настоящий путь записывает в парный файл $I рядом. Всё, что спрашивает имя у
папки Корзины, получает настоящее имя; всё, что смотрит на сам файл на диске,
видит служебное.
Запрос в стиле XP смотрит на файл на диске: он спрашивает у SHGetFileInfo
отображаемое имя пути C:\$Recycle.Bin\<SID>\$RVAZ2WZ.b, а для обычного пути к
файлу это просто имя файла, то есть служебное.
Когда у SHGetFileInfo спрашивают отображаемое имя $R-файла в папке
$Recycle.Bin, мод отвечает именем, записанным в соседнем файле $I, - это
одно чтение маленького файла, без всякого поиска. Если включено «Показывать
полный исходный путь», ответом будет весь путь, откуда файл был удалён.
Всё остальное проходит без изменений, а $R-файл без соседнего $I остаётся
со своим именем.
Мод ничего не меняет в содержимом Корзины, в её окне и в самих файлах - только
имя, которое запрос собирается показать.
Проверено только на Windows 11 24H2 (сборка 26100). На других версиях Windows мод не проверялся и может не работать.