Jump to content
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble

MSFN is made available via donations, subscriptions and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. Alternatively, register and become a site sponsor/subscriber and ads will be disabled automatically. 


Recycle bin for network shares

Recommended Posts

I want a recycle bin for network shares. ie, some way to undelete files and folders from a shared driver or folder. It is quite easy to delete something from a network share, even by accident, but difficult to use many undelete utilities due to the file system on the share (which might be RAID). Some network share software and devices (NAS) have the ability to implement a recycle bin but this is not always available and the implementation tends to not be robust.

I was messing around with a few ideas like using an AutoHotkey script to intercept delete actions and turn them into move actions. Shadow Copy holds potential but doesn't seem to quite fit the bill.

Finally found this neat trick on another forum which leverages special folders in user profiles. I tested it out a bit and it works surprisingly well.

You may have noticed that when you delete a file stored on a network location or mapped network drive that the file is permanently deleted. It does not go to the local computer's recycle bin and does not go to the server's recycle bin. I have discovered a work-around that extends recycle bin coverage to include mapped network drives. The solution is not 100% perfect, but works extremely well and does not rely on Shadow Copies or 3rd-party software.

Here's how:

1. Map a network drive to the network share you want to use. Make sure that the drive is re-connected on logon. If you don't know how to do this, search Google.

2. Browse to C:\users\<user name>.

3. Right-click on one of the folders in this location (I chose saved games) and click properties.

4. Select the Location tab.

5. Click Move, browse to to root of the drive you mapped in step 1, and click Select Folder.

6. Click Ok and click yes in the dialogue box that appears.

7. Repeat these same steps for all users on the computer.

You can now verify that the network drive is protected by the recycle bin by right-clicking on the recycle bin and clicking properties. The network drive should be listed in the Recycle Bin Locations column.

Some warnings:

1. This only protects files accessed through the mapped network drive, and not by UNC paths. So for example, if you mapped \\server\share to z:, and delete something off the z drive, it will go to the recycle bin. However, if you browse to \\server\share and delete a file, it will be deleted directly.

2. I don't know what will happen if your network drive is not available, so beware. This may not work well with laptops.

3. What ever files that were supposed to be stored in the folder you select in step 3 will now be stored on your mapped network drive by default. This can actually be quite useful.

Future goals:

I don't currently know how to add this functionality to additional folders. As far as I can tell, only folders stored in C:\users\<user name> get this functionality. I'm still looking into this, but will update this post if I find additional information.


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

Share this post

Link to post
Share on other sites

I always read that the Server 2008 R2 functional domain level has a shared network recycle bin, which was never anything that any server I've set up ever needed, which I use just the 2008 RTM functional level. Is this a manual way to set that up then?

Share this post

Link to post
Share on other sites

This trick should work only on windows 7 (if i understood correctly). I would still prefer shadow copies as you can restore even an old version of the file and are a lot reliable if you configure them properly.

Share this post

Link to post
Share on other sites

If your file servers are Windows sever based the easiest is to turn on Volume Shadow Copy, then you can use the restore previous versions functionality built in to the OS.

Share this post

Link to post
Share on other sites

Here is a tool that lets you view this in effect and make changes:

Known Folders Browser 1.0 (for Vista and Beyond)


Are you finding all the “special folders” in Windows Vista a bit overwhelming? Which are real folders and which are virtualized? Which are profile-specific and which are common to all users? Which are rooted and which are relative? I did too at first.

Previous versions of Windows included the concept of “special folders”. Each version of Windows published more of these special folders in terms of constant special item identifier list values, or CSIDLs for short. Functions are provided for getting and setting the folder given a CSIDL value. Managed code can access the subset of these known at the time that a particular version of the .NET Framework was written through the Environment.SpecialFolder enumeration. My Special Folders Browser tool allows you to visually browse the list of special folders known to the .NET Framework.

It has however become apparent that a better mechanism is required for managing the growing list of well-known folders and Microsoft has provided just such as mechanism in Windows Vista. Windows Vista introduces a new registry of known folders that can be enumerated and manipulated with much greater control. I had planned to write an article for my Windows Vista for Developers series on the Known Folders API but it just hasn’t seemed interesting enough to write about. Do let me know if this interests you and I may reconsider. I did however write a tool to visualize the known folders and simplify the management of these folders.

Known Folders Browser 1.0 visually displays the known folders on your computer and provides the following notable features:

Visualizes folder relationships by nesting relative folders beneath parent folders

Displays folder icons, tooltips and other localized information

Displays detailed folder properties (for developers)

Context menus with handy options

Commands for:

Opening in Explorer (or Command Window on Server Core)

Changing a folder’s path

Copying a folder’s path to the clipboard

Known Folders Browser 1.0 is provided in both x86 and x64 versions. The x86 build will also run on Windows x64 but you may prefer to run the x64 image natively, as I do. It’s also useful to run both versions since the known folders may point to different system folders depending on whether your application is x86 or x64 native.

KnownFoldersBrowser.exe (x86)

KnownFoldersBrowser.exe (x64)

Latest version: 1.0.2

Share this post

Link to post
Share on other sites

Just a quick note to say that I've been using the method in the first post for quite some time now and it works great.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.