Home > Enterprise >  Accessing the Windows Recycle Bin in WSL2
Accessing the Windows Recycle Bin in WSL2

Time:11-28

In WSL2, is it possible to access the Windows Recycling Bin? Say for example you move file.txt into the recycling bin in the Windows GUI, could you move to the directory that file.txt is contained in on the WSL terminal? How could this be done?

CodePudding user response:

Officially, no. A special implementation of IShellFolder in shell32 handles the recycle bin when files are moved/deleted in the shell namespace.

Unofficially, each drive contains a hidden $Recycle.Bin folder (Recycler before Vista). Each user has a directory inside there named after their SID where their deleted files are stored.

The deleted files do not retain their original filenames, only their extension. Before Vista, a file named INFO2 stored this information. These days $I... stores the information for the original files renamed to $R...

Look at forensics tools like Rifiuti2 if you need to understand the internal format so you can extract the original name...

  • Related