使用Network Recycle Bin啓用映射網絡驅動器上的回收站

前言

在內網環境中咱們常常會使用NAS或者Samba在Windows中映射網絡驅動器,方便局域網用戶實時共享交換數據。但當存儲在網絡或映射網絡上的任何文件被刪除時,該文件將被永久刪除。它不會去到本地計算機回收站,也不會去到服務器的回收站,我經過google在mydigitallife和microsoft technet中搜索到不少方法,但針對不一樣操做系統且涉及到域用戶管理的複雜狀況下,單純的依賴註冊表修改可能已經支撐不住需求的膨脹了。在全部的方法中使用Network Recycle Bin能夠輕鬆解決映射網絡驅動器上的回收站。html

使用Network Recycle Bin爲局域網巧設「回收站」

更新歷史

2018年04月20日 - 初稿git

閱讀原文 - https://wsgzao.github.io/post...github

擴展閱讀windows

Network Recycle Bin Tool - http://www.networkrecyclebin....服務器


如何啓用映射網絡驅動器上的回收站

映射驅動器不過是將本地驅動器鏈接到另外一臺計算機上特別分配的共享目錄或文件夾。 一旦驅動器被映射,您就能夠訪問共享資源,您能夠像對待您的系統本地同樣對待它。能夠將多個計算機驅動器映射到共享資源,並利用此網絡空間。網絡

當存儲在網絡或映射網絡上的任何文件被刪除時,該文件將被永久刪除。 它不會去到本地計算機回收站,也不會去到服務器的回收站。 爲了不未來出現這種數據丟失狀況,您能夠在映射的網絡驅動器上啓用回收站。 按照如下給出的步驟在映射的網絡驅動器上啓用回收站.app

  1. 將網絡驅動器映射到要使用的網絡共享。 確保登陸後從新鏈接驅動器
  2. 而後進入C:> 用戶 > 用戶名
  3. 右鍵單擊該位置的任何文件夾,而後單擊 屬性 > 位置選項卡
  4. 單擊移動並瀏覽根驅動器(在步驟1中映射),而後點擊選擇文件夾
  5. 而後點擊 好 並當對話框出現命中 是
  6. 只需在PC上爲每一個用戶重複這些步驟

注意:要驗證此過程是否正常工做,請右鍵單擊回收站並轉至屬性,並檢查網絡驅動器是否在回收站的位置列中列出。ide


須要注意的事情post

這僅適用於經過映射的網絡驅動器而不是UNC路徑訪問的文件。 咱們舉一個例子:若是你已經將\servershare映射到E:並從這個E:驅動器中刪除了一些東西,那麼它將會進入回收站。 可是,若是您瀏覽到\servershare並擦除文件,它將被永久刪除。測試

Enable Recycle Bin on mapped network drives

方案1,經過重定向文件位置的方式我本身在Windows 10下測試可用,但Windows 7失敗了

https://forums.mydigitallife....

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.
方案2,經過修改註冊表搞定回收站問題,實際測試喜憂參半,通用性不高,不推薦

https://social.technet.micros...

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 %1=%RESULT% 
  
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

Network Recycle Bin Tool簡介

本文主要使用Network Recycle Bin Tool Personal Client Machine Edition客戶端

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使用方法

使用方法很是簡單,安裝好Network Recycle Bin Tool只須要4步便可,其它需求能夠自定義Options
  1. 選擇Protect Folders添加你須要保護的的映射網絡驅動器
  2. Options中確認刪除文件的存儲路徑,默承認以不修改
  3. 在映射網絡驅動器中嘗試刪除測試文件,在Deleted Files能夠看到刪除的文件
  4. 能夠批量選中要恢復或者刪除的文件點擊Recovery Files或者Delete Files



相關文章
相關標籤/搜索