MSFN Forum: Recycle bin for network shares - MSFN Forum

Jump to content


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Recycle bin for network shares Undelete remote folders and files Rate Topic: -----

#1 User is offline   tain 

  • Cyber Ops
  • Group: Super Moderator
  • Posts: 3,557
  • Joined: 24-September 05
  • OS:none specified
  • Country: Country Flag

Posted 09 December 2011 - 08:13 AM

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.

Quote

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.

--Russel
Source: http://forums.mydigi...ork-Recycle-bin


#2 User is offline   Tripredacus 

  • K-Mart-ian Legend
  • Group: Super Moderator
  • Posts: 8,670
  • Joined: 28-April 06
  • OS:Server 2012
  • Country: Country Flag

Posted 09 December 2011 - 09:50 AM

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?

#3 User is offline   allen2 

  • Not really Newbie
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1,736
  • Joined: 13-January 06

Posted 09 December 2011 - 02:36 PM

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.

#4 User is offline   IcemanND 

  • MSFN Junkie
  • Group: Super Moderator
  • Posts: 3,266
  • Joined: 24-September 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 09 December 2011 - 07:37 PM

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.

#5 User is offline   tain 

  • Cyber Ops
  • Group: Super Moderator
  • Posts: 3,557
  • Joined: 24-September 05
  • OS:none specified
  • Country: Country Flag

Posted 29 April 2012 - 08:28 AM

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

Known Folders Browser 1.0 (for Vista and Beyond)
http://weblogs.asp.n...yond_2900_.aspx

Quote

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 topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2013 msfn.org
Privacy Policy