Skip to content

Instantly share code, notes, and snippets.

@maxkagamine
Last active October 30, 2024 09:06
Show Gist options
  • Save maxkagamine/0c31f5ec6fdd3fb43a1d72ae033b4c90 to your computer and use it in GitHub Desktop.
Save maxkagamine/0c31f5ec6fdd3fb43a1d72ae033b4c90 to your computer and use it in GitHub Desktop.
Recycle Bin can be enabled on a mapped network drive by defining a Known Folder in the registry. (Also a way to create custom user folders. For adding folders to This PC, though, it seems you need to create a CLSID entry instead; use Winaero Tweaker for that.)
Windows Registry Editor Version 5.00
; For folder icons, set folder to read-only and create a desktop.ini set to
; read-only|system|hidden with contents:
; [.ShellClassInfo]
; IconResource=C:\Path\To\Icon.ico,0
; Remember to change the guid for each known folder:
; https://www.guidgenerator.com/
; https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/ns-shobjidl_core-knownfolder_definition
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{E40D77EC-D4D6-4099-9746-A81C56EA49D5}]
"Category"=dword:00000004
; The known folder name can be typed into the explorer address bar (or Run
; dialog, etc.) to navigate to the folder, e.g. "shell:Books"
"Name"="Books"
; Uncomment ParentFolder to make relative to user profile folder
; Other known folder ids: https://docs.microsoft.com/en-us/windows/win32/shell/knownfolderid#constants
;"ParentFolder"="{5E6C858F-0E22-4760-9AFE-EA3317B67173}"
"RelativePath"="S:\\Books"
; Enables recycle bin for a location that otherwise wouldn't have one (i.e. network share)
; 500,000 MB = 0007a120
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\BitBucket\KnownFolder\{E40D77EC-D4D6-4099-9746-A81C56EA49D5}]
"MaxCapacity"=dword:0007a120
"NukeOnDelete"=dword:00000000
@maxkagamine
Copy link
Author

@smartcooky99 I believe the Name is more of an internal identifier, not actually the folder name, so you can probably just put whatever makes sense, like "Fileinbox". If you scroll through the FolderDescriptions key, you'll see names like "UserProgramFiles" and "OneDriveDocuments". For the RelativePath, when there's no ParentFolder it's just the full path, so A:\\ should be right (backslashes need to be escaped; A: might work too).

@smartcooky99
Copy link

OK, thanks for the prompt reply. I'll post back here once I've done it.

@smartcooky99
Copy link

Yup... worked perfectly... recycles to the bin from the network drive, and restores OK as well

Didn't even need to escape the backslashes

Thank you!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment