Enable Recycle Bin on mapped network drives

A few years ago I discovered how redirected user profile folders in Windows get Recycle Bin protection, even when the folders are redirected to a network location. This was a huge find for me, and I used this feature to add Recycle Bin coverage to some of my mapped network drives. I shared this information on another forum here:

http://forums.mydigitallife.info/threads/16974-Tip-Network-Recycle-bin

Today I figured out a better way to achieve the same goal that doesn't rely on user profile folder redirection, and am sharing that information for other users to try out. You might want to take a look at these forum topics for additional information:

The standard disclaimer applies - this might break stuff. I've only tested in Windows 8, and my testing is limited. Try this at your own risk.

This is what I've learned (or think I've learned - I might be wrong):

  • Windows Vista and later store the configuration settings for the Recycle Bin for redirected user profile folders in this registry key: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\BitBucket\KnownFolder
  • Under this key are separate keys for each redirected folder that is protected by the Recycle Bin. The keys contain the configuration information for each protected folder, and are named to match the GUIDs for "Known Folders." A list of the Known Folder to GUID mappings is available in one of the links above.
  • The registry also contains a list of "known folders" at this location: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions

So, I reasoned that if I could create my own custom "known folder," I could add that to the list of folders that were protected by the Recycle Bin and protect any mapped network drive I wanted. So I looked at the list of existing "known folders" and created a key that was similar to the Documents key. I then fiddled with the values in the key until I narrowed it down to the minimum number needed to make the recycle bin work.

This .reg file will protect a mapped X: drive with a ~50GB recycle bin. You should modify the file to fit your needs:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{9147E464-33A6-48E2-A3C9-361EFD417DEF}]
"RelativePath"="X:\\"
"Category"=dword:00000004
"Name"="XDrive"

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\BitBucket\KnownFolder\{9147E464-33A6-48E2-A3C9-361EFD417DEF}]
"MaxCapacity"=dword:0000c7eb
"NukeOnDelete"=dword:00000000

A few things of note:

  • The GUID in the above .reg file {9147E464-33A6-48E2-A3C9-361EFD417DEF} came from this PowerShell command: "{"+[guid]::NewGUID().ToString().ToUpper()+"}"
  • Each "known folder"/Recycle Bin combination requires a unique GUID. If you don't want to use PowerShell to generate a GUID, you can use an online GUID generator.
  • I don't know what the "Category" value does, but the key I copied had it set to 4, and that works, so I didn't test any other values.
  • The "Name" value is required, but is not the name that will be shown if you right-click on the Recycle Bin and select properties. (At least not in my environment.) In my environment, the name that is shown is the name of the network drive.
  • Making this change adds a "Location" tab to the properties page of your mapped network drives. I suspect this could be removed by changing the "Category" value, but didn't bother to find out.
  • I only tested with mapped network drives. I suspect this would work with UNC paths as well, but I didn't bother testing.

I hope you're as excited to find this as I was to figure it out. Let me know if this works for you. I now plan to deploy the registry keys with Group Policy Preferences and will update this forum post with any information I discover.

Best regards

--Russel

Update: I am now using Group Policy Preferences to deploy the needed registry keys, and all my mapped network drives are now protected by the recycle bin.

  • Edited by Russel Riley Tuesday, December 03, 2013 3:39 PM Update regarding GPP
October 3rd, 2013 9:27am

Thanks for sharing this. I appreciate your efforts.
Free Windows Admin Tool Kit Click here and download it now
October 9th, 2013 6:11am

Hello there,

I was playing around with this and after it moves the files in the folder to the network share it deletes the folder from the users PC.  How do I go about undoing this change?  I attempted to remove the registry entries but that did not work.

Thank you

February 13th, 2014 11:16pm

Hi Nnyan,

I'm not sure what you've done in your environment, but from the context of your post, it sounds like you've redirected a user profile folder to a network share. When you move a user profile folder (like c:\<username>\documents) to another location, Windows prompts you if you would like to move the files. If you click yes, it moves them to the new location. To move the files back, just move the files back. If you want them to be available in both locations, just move them to the network location and make them available offline.

HTH

-Russel

Free Windows Admin Tool Kit Click here and download it now
February 15th, 2014 2:07pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics