preface
In the Intranet environment, NAS or Samba are often used to map network drives in Windows to facilitate real-time sharing of exchange data among LAN users. But when any file stored on the network or mapped network is deleted, the file is permanently deleted. It doesn’t go to the local computer recycle bin, it doesn’t go to the server recycle bin, I’ve googled a lot of methods in MyDigitalLife and Microsoft TechNet, but for different operating systems and complex situations involving domain user management, Relying solely on registry changes may not be enough to support the expansion in demand. Using the Network Recycle Bin in all of these methods can easily solve the problem of mapping the Recycle Bin on the Network drive.
Use Network Recycle Bin to Skillfully set up “Recycle Bin” for LAN
Update history
April 20, 2018 – First draft
Read the original – https://wsgzao.github.io/post/network-recycle-bin/
Further reading
Network Recycle Bin Tool – http://www.networkrecyclebin.info/index.html
How do I enable a mapped recycle bin on a network drive
A mapped drive is nothing more than connecting a local drive to a specially assigned shared directory or folder on another computer. Once the drive is mapped, you can access the shared resource, and you can treat it as if it were local to your system. You can map multiple computer drives to a shared resource and take advantage of this network space.
When any file stored on the network or mapped network is deleted, the file is permanently deleted. It doesn’t go to the local computer recycle bin, and it doesn’t go to the server recycle bin. To avoid this data loss situation in the future, you can enable the recycle bin on the mapped network drive. Follow the steps given below to enable the recycle bin on the mapped network drive.
- Map the network drive to the network share you want to use. Be sure to reconnect the drive after logging in
- Then go to C: > User > User name
- Right-click any folder in that location, and then click the Properties > Locations TAB
- Click Move and browse the root drive (mapped in Step 1), then click Select Folder
- Then click OK and when the dialog box hits yes
- Just repeat these steps for each user on your PC
Note: To verify that this procedure is working properly, right-click the recycle bin and go to properties, and check if the network drive is listed in the location column of the recycle bin.
Things to watch out for
This only applies to files accessed through a mapped network drive rather than an UNC path. Let’s take an example: if you have mapped \server\ Share to E: and removed something from this E: drive, it will go to the recycle bin. However, if you browse to \server\ Share and erase the file, it will be deleted permanently.
Enable Recycle Bin on mapped network drives
Option 1, which I tested myself on Windows 10 by redirecting the file location, failed on Windows 7
https://forums.mydigitallife.net/threads/tip-network-recycle-bin.16974/
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:
- 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.
- Browse to C:\users<user name>.
- Right-click on one of the folders in this location (I chose saved games) and click properties.
- Select the Location tab.
- Click Move, browse to to root of the drive you mapped in step 1, and click Select Folder.
- Click Ok and click yes in the dialogue box that appears.
- Repeat these same steps for all users on the computer.
Scheme 2, through modifying the registry to solve the problem of the recycle bin, the actual test is mixed, not high versatility, not recommended
https://social.technet.microsoft.com/Forums/windows/en-US/a349801f-398f-4139-8e8b-b0a92f599e2b/enable-recycle-bin-on-map ped-network-drives
Just copy and paste the following into notepad and save it as “Network Recycling Bin – auto make registry file.bat”
echo off
REM ========== MAIN FUNCTION ========================
Call :CreateREGfile
PAUSE
goto :eof
REM ========== SUB FUNCTIONS ========================
:CreateREGfile
set /p RelativePath=Enter current mapped path of drive (e.g. X:\FileShare\D_Drive):
REM replace \ with \\ (for reg value its a requirement)
Set RelativePath=%RelativePath:\=\\%
set /p MaxBinSize_Dec=Enter max size (in mb) (eg 11gb=11000) :call :toHex %MaxBinSize_Dec% MaxBinSize_Hex
Set outputREG="Network Recycling Bin - % % RelativePath: ~ 0, 1 Drive (%MaxBinSize_Dec%mb).reg"
call :MakeGUID_VBS NewGUID
REM echo My new GUID : %NewGUID%
echo Windows Registry Editor Version 5.00 > %outputREG%
echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\%NewGUID%] > >%outputREG%
echo "RelativePath"="%RelativePath%" >> %outputREG%
echo "Category"=dword:00000004 >> %outputREG%
echo "Name"="NetworkDrive2RecyclingBin_% % NewGUID: ~ 1, 5" >> %outputREG%
REM 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. That will be autoset to the network drive name.
echo. > >%outputREG%
echo [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\BitBucket\KnownFolder\%NewGUID%] > >%outputREG%
echo "MaxCapacity"=dword:%MaxBinSize_Hex% >> %outputREG%
echo "NukeOnDelete"=dword:00000000 >> %outputREG%
goto :eof
:MakeGUID_VBS
echo set obj = CreateObject("Scriptlet.TypeLib") > TEMP_generateGUID.vbs
echo WScript.Echo obj.GUID >> TEMP_generateGUID.vbs
FOR /F "usebackq tokens=*" %%rin (`CSCRIPT "TEMP_generateGUID.vbs"`)DO SET RESULT=%%r
set = % % 1RESULT%
del TEMP_generateGUID.vbs
goto :eof
:toDec
:: todec hex dec -- convert a hexadecimal number to decimal
:: -- hex [in] - hexadecimal number to convert
:: -- dec [out,opt] - variable to store the converted decimal number in
SETLOCAL
set /a dec=0x%~1
( ENDLOCAL & REM RETURN VALUES
IF"% ~2" NEQ "" (SET 2 = % % ~dec%)ELSE ECHO.%dec%
)
EXIT /b
:toHex
:: eg call :toHex dec hex -- convert a decimal number to hexadecimal, i.e. -20 to FFFFFFEC or 26 to 0000001A
:: -- dec [in] - decimal number to convert
:: -- hex [out,opt] - variable to store the converted hexadecimal number in
::Thanks to 'dbenham' dostips forum users who inspired to improve this function
:$created 20091203 :$changed 20110330 :$categories Arithmetic,Encoding
:$source http://www.dostips.com
SETLOCAL ENABLEDELAYEDEXPANSION
set /a dec=%~1
set "hex="
set "map=0123456789ABCDEF"
for /L %%Nin (1.1.8)do (
set /a "d=dec&15,dec>>=4"
for %%Din (! d!)do set "hex=! map:~%%D,1!! hex!")rem !!!! REMOVE LEADING ZEROS by activating the next line, e.g. will return 1A instead of 0000001A
rem for /f "tokens=* delims=0" %%A in ("%hex%") do set "hex=%%A"&if not defined hex set "hex=0"
( ENDLOCAL & REM RETURN VALUES
IF"% ~2" NEQ "" (SET 2 = % % ~hex%)ELSE ECHO.%hex%
)
EXIT /b
:eof
Copy the code
Network Recycle Bin Tool Introduction
This paper mainly uses the Network Recycle Bin Tool Personal Client Machine Edition Client
Server Edition
Version 6.1.1.3
This version has been designed for the server usage. You should install it on the server to monitor shared folders. When network user will delete a shared file it will copy it to the “network recycle bin”. You have not install any additional software on client machines.
Personal Client Machine Edition
Version 5.2.3.8
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
.
How to enable a recycle bin for shared folders on a network ? There is the proper solution of restoring and securing your information even after deleting it – The Network Recycle Bin Tool allows you to recover deleted files.
Once you have this tool in your system, it will automatically keep a track of all the network deleted files and you can easily recover them. Instead of removing the files, this tool sends them directly to its predefined recycle bin folder.
There are various options to tune it up. For example: you can set size limits for files stored in the Network Recycle Bin
, you can define the list of network drives or network folders to track deleted files.
Additionaly it offers you the Protect Files tool which prevents deletion of network files for specified folders according the file mask. Export and import functions help you to install software with same options on network machines. The password control disallows unauthorized access.
In the long run, losing your important network files and information accidentally is not an issue these days. Instead of getting anxious and worried, feel free to download network recycle bin tool from any reliable source and make sure that you have pre-installed this recovery tool
.
Network Recycle Bin Tool Usage
It takes only 4 steps to install the Network Recycle Bin Tool. You can customize Options for other requirements
- choose
Protect Folders
Add mapped network drives that you need to protect - in
Options
To confirm the storage path for deleting files. By default, no modification is required - Attempted to delete the test file in the mapped network drive, in
Deleted Files
You can see the deleted files - To batch select files to restore or delete click
Recovery Files
orDelete Files