Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account



Photo

Recycle bin for network shares

- - - - -

  • Please log in to reply
5 replies to this topic

#1
tain

tain

    Cyber Ops

  • Super Moderator
  • 3,685 posts
  • Joined 24-September 05
  • OS:none specified
  • Country: Country Flag

Donator

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.

--Russel

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


How to remove advertisement from MSFN

#2
Tripredacus

Tripredacus

    K-Mart-ian Legend

  • Super Moderator
  • 10,022 posts
  • Joined 28-April 06
  • OS:Server 2012
  • Country: Country Flag

Donator

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?
MSFN RULES | GimageX HTA for PE 3-5 | lol probloms
tpxmsfn1_zps393339c1.jpg

#3
allen2

allen2

    Not really Newbie

  • Member
  • PipPipPipPipPipPipPip
  • 1,814 posts
  • Joined 13-January 06
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
IcemanND

IcemanND

    MSFN Junkie

  • Super Moderator
  • 3,266 posts
  • Joined 24-September 03
  • OS:Windows 8.1 x64
  • Country: Country Flag
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
tain

tain

    Cyber Ops

  • Super Moderator
  • 3,685 posts
  • Joined 24-September 05
  • OS:none specified
  • Country: Country Flag

Donator

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

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



#6
tain

tain

    Cyber Ops

  • Super Moderator
  • 3,685 posts
  • Joined 24-September 05
  • OS:none specified
  • Country: Country Flag

Donator

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.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users