2

I am accessing one of my computers through SMB (file sharing) and I am running into a problem. I am trying to access the Recycle Bin but it does not work. I read it is DriveLetter/$Recycle.Bin, so I tried accessing C:\$Recycle.Bin but the folder is empty, I don't think that could be it though since the recycle bin isn't shared between users. How would I go about viewing the recycle bin?

Edit: If it is not possible? is there a batch command I can try to get the recycle bin to show and hide it from the file sharing later?

1
  • dir /a C:\$Recycle.Bin or icacls C:\$Recycle.Bin\* /C etc.
    – JosefZ
    Commented Jun 11, 2016 at 12:10

2 Answers 2

1

There are two things to watch out for here.

First, you have to be showing both hidden and system files to see the contents of $Recycle.Bin. Open your Folder Options dialog and switch to the View tab. Select Show hidden files, folders, and drives and uncheck Hide protected operating system files.

folder options

Then, you'll be able to see the subfolders of $Recycle.Bin in Explorer. The only subfolder you'll be able to access is the one corresponding to the user you're authenticated as; that folder will show up as Recycle Bin with a recycle bin icon. (The others show up as SIDs.) But when you open your subfolder, you'll see the contents of the Recycle Bin of the machine you're browsing from. That's because the desktop.ini in that folder sets a special shell folder view for it, and Explorer thinks it should display the current user's Recycle Bin contents from the current machine.

You could use the command prompt to poke around that folder. If you really want to use Explorer, you need to make it so the Explorer you're browsing from can't process desktop.ini. On the machine that owns the Recycle Bin in question, use a command prompt to navigate to the subfolder your user owns. Use trial-and-error to get the right one (dir /a and tab completion will help here) or look up your SID with whoami /all. Once you're in, run this command to block only network access to desktop.ini:

icacls desktop.ini /deny NETWORK:F

You'll then be able to browse that folder over the network like any other, and local use of the Recycle Bin will be unaffected. Unfortunately, the file names will be garbled because of how the Recycle Bin stores things. You'll see the folder contents as they really are on-disk.

If you want to undo that icacls change, use this:

icacls desktop.ini /remove NETWORK
-1

If you know the SID you can view the contents via the commandline using the C$ share.

1
  • 3
    Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented May 31, 2023 at 17:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .