使用Network Recycle Bin启用映射网络驱动器上的回收站

前言

在内网环境中我们经常会使用NAS或者Samba在Windows中映射网络驱动器,方便局域网用户实时共享交换数据。但当存储在网络或映射网络上的任何文件被删除时,该文件将被永久删除。它不会去到本地计算机回收站,也不会去到服务器的回收站,我通过google在mydigitallife和microsoft technet中搜索到很多方法,但针对不同操作系统且涉及到域用户管理的复杂情况下,单纯的依赖注册表修改可能已经支撑不住需求的膨胀了。在所有的方法中使用Network Recycle Bin可以轻松解决映射网络驱动器上的回收站。

使用Network Recycle Bin为局域网巧设“回收站”

更新历史

2018年04月20日 - 初稿

阅读原文 - https://wsgzao.github.io/post/network-recycle-bin/

扩展阅读

Network Recycle Bin Tool - http://www.networkrecyclebin.info/index.html


如何启用映射网络驱动器上的回收站

映射驱动器不过是将本地驱动器连接到另一台计算机上特别分配的共享目录或文件夹。 一旦驱动器被映射,您就可以访问共享资源,您可以像对待您的系统本地一样对待它。可以将多个计算机驱动器映射到共享资源,并利用此网络空间。

当存储在网络或映射网络上的任何文件被删除时,该文件将被永久删除。 它不会去到本地计算机回收站,也不会去到服务器的回收站。 为了避免将来出现这种数据丢失情况,您可以在映射的网络驱动器上启用回收站。 按照以下给出的步骤在映射的网络驱动器上启用回收站.

  1. 将网络驱动器映射到要使用的网络共享。 确保登录后重新连接驱动器
  2. 然后进入C:> 用户 > 用户名
  3. 右键单击该位置的任何文件夹,然后单击 属性 > 位置选项卡
  4. 单击移动并浏览根驱动器(在步骤1中映射),然后点击选择文件夹
  5. 然后点击 好 并当对话框出现命中 是
  6. 只需在PC上为每个用户重复这些步骤

注意:要验证此过程是否正常工作,请右键单击回收站并转至属性,并检查网络驱动器是否在回收站的位置列中列出。

需要注意的事情

这仅适用于通过映射的网络驱动器而不是UNC路径访问的文件。 我们举一个例子:如果你已经将\server\share映射到E:并从这个E:驱动器中删除了一些东西,那么它将会进入回收站。 但是,如果您浏览到\server\share并擦除文件,它将被永久删除。

Enable Recycle Bin on mapped network drives

方案1,通过重定向文件位置的方式我自己在Windows 10下测试可用,但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:

  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.microsoft.com/Forums/windows/en-US/a349801f-398f-4139-8e8b-b0a92f599e2b/enable-recycle-bin-on-mapped-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 %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

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/283510.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Vite执行npm run serve后浏览器报Cannot GET /

在使用 Vite 时&#xff0c;想像以前执行 npm run serve 一样&#xff0c;查看生产环境的应用。 在执行后并未发现异常&#xff0c;但在浏览器访问时&#xff0c;显示 Cannot GET /&#xff0c;说是找不到根目录。 在网上查找解决方案&#xff0c;发现并没有结果。可能是还没有…

1.2开发文档简读,了解全貌.mp4

转载于:https://www.cnblogs.com/ZHONGZHENHUA/p/6910254.html

开源:一款开源的高颜值现代化桌面美化工具

背景在日常的工作或学习中&#xff0c;难免会有一些临时的文件夹&#xff0c;文件&#xff0c;应用&#xff0c;出现在你的桌面&#xff0c;但是呢你又不确定它是不是哪一天会突然用到&#xff0c;这样一天又一天&#xff0c;直至你的电脑桌面是一片狼藉&#xff0c;满屏的文件…

10月31日,面试题小结

localStorage和sessionStorage localStorage和sessionStorage一样都是用来存储客户端临时信息的对象。 他们均只能存储字符串类型的对象&#xff08;虽然规范中可以存储其他原生类型的对象&#xff0c;但是目前为止没有浏览器对其进行实现&#xff09;。 localStorage生命周期…

软件工程—团队作业1

软件工程—团队作业1 团队称号&#xff1a;Thanos &#xff08;灭霸&#xff0c;超叼的一个动漫人物&#xff09; 团队成员&#xff1a; 队长 成凯 1600802002 博客链接&#xff1a; http://www.cnblogs.com/ck03/ 党康 1600208004 博客链接&#xff1a; http://www.cnblogs…

Nginx单服务器部署多个网站,域名

Nginx部署多网站 一个反向代理服务器&#xff0c;集中处理请求&#xff0c;转发到其他服务器上 一、单网站单服务器的Nginx配置 server {listen 80; # 监听80端口server_name www.google.com google.com; # 带www域名和不带www域名都指向该网站资源location / {root /…

Comparable、Iterator接口和Collections类的实现方法

Comparable接口&#xff1a; 此接口强行对实现它的每个类的对象进行整体排序。这种排序被称为类的自然排序&#xff0c;类的 compareTo 方法被称为它的自然比较方法。 实现此接口的对象列表&#xff08;和数组&#xff09;可以通过 Collections.sort&#xff08;和 Arrays.sort…

k8s 读书笔记 - kubernetes 基本概念和术语(上)

k8s 资源控制系统k8s 中大部分概念如&#xff1a;Node、Pod、Replication Controller、RS、Deployment、Service 等都可以被看作一种资源对象&#xff0c;激活所有的资源对象都可以通过 k8s 提供 kubectl 工具&#xff08;或者 API 编程调用&#xff09;执行 CRUD 等操作并将其…

CentOs6.5下安装svn

1、检查是否已安装 rpm -qa subversion 1、1如果需要卸载旧版本&#xff08;如果想在一台机器安装不同svn&#xff0c;切记不要执行此步骤&#xff01;&#xff01;&#xff01;&#xff09; yum remove subversion 2、安装 yum install subversion 3、检查安装是否成功 svnser…

奉献一波鹅厂的面经!纪念最后的校招!| 掘金技术征文

薪资:special offer(已收到正式offer) 个人情况:主要做后台研发方向(c/c&#xff0b;&#xff0b;/java)都用过&#xff0c;末流985计算机专业硕士&#xff0c;有过长达一年半的实习工作经历。计算机基础&#xff0c;算法&#xff0c;项目都还马马虎虎。之前秋招有运气好有拿到…

Git remote: Access deniedfatal: unable to access ‘https://gitee.com/* 正确的解决办法

错误信息类似于&#xff1a; remote: [session-********] Access denied fatal: unable to access https://gitee.com/*/*.git/: The requested URL returned error: 403 如果是私有项目&#xff0c;请将remote地址改为: https://yournamegitee.com/…… https://yournameg…

Android 升级到android studio 2.2项目死活run不起来

背景&#xff1a;升级到Android studio 2.2项目死活运行不起来 现象如下&#xff1a; run with --stacktrace --debug等等抛出的bug简直无法忍视 解决办法&#xff1a;把compileSdkVersion 改为23成功run起来了

android 打开系统相机,

1.第一步在androidmanifest。xml中注册 <uses-permission android:name"android.permission.WRITE_EXTERNAL_STORAGE" /><uses-permission android:name"android.permission.READ_EXTERNAL_STORAGE" /> 2.第二步创建activity_creama.xml <R…

【python】-- Django 中间件、缓存、信号

Django 中间件、缓存、信号 一、 Django 中间件 django 中的中间件&#xff08;middleware&#xff09;&#xff0c;在django中&#xff0c;中间件其实就是一个类&#xff0c;在请求到来和结束后&#xff0c;django会根据自己的规则在合适的时机执行中间件中相应的方法。 在d…

【温故知新】C#中 IEnumerable 与IQueryable

微信公众号&#xff1a;趣编程ACE关注可了解更多的.NET日常实战开发技巧&#xff0c;如需源码 后台回复 源码 即可;如果觉得对你有帮助&#xff0c;欢迎关注老生常谈 C#中 IEnumerable 与IQueryableIEnumerable 与 IQueryable 对于.Neter来说并不陌生&#xff0c;今天我就着重阐…

5个知识点,让 Vue3 开发更加丝滑

一、setup name 增强 Vue3的setup语法糖是个好东西&#xff0c;但使用setup语法带来的第一个问题就是无法自定义name&#xff0c;而我们使用keep-alive往往是需要name的&#xff0c;解决这个问题通常是通过写两个script标签来解决&#xff0c;一个使用setup&#xff0c;一个不使…

石子归并 51Nod - 1021

N堆石子摆成一条线。现要将石子有次序地合并成一堆。规定每次只能选相邻的2堆石子合并成新的一堆&#xff0c;并将新的一堆石子数记为该次合并的代价。计算将N堆石子合并成一堆的最小代价。 例如&#xff1a; 1 2 3 4&#xff0c;有不少合并方法1 2 3 4 > 3 3 4(3) > 6 4…

Scala基础 - _root_ package的作用

2019独角兽企业重金招聘Python工程师标准>>> 在Scala中引入类时支持相对路径&#xff0c;例如&#xff1a; import play.api.libs.json._ import play.api.libs.json.util.LazyHelper可以简写成&#xff1a; import play.api.libs.json._ import util.LazyHelper通常…

使用.NET简单实现一个Redis的高性能克隆版(六)

译者注该原文是Ayende Rahien大佬业余自己在使用C# 和 .NET构建一个简单、高性能兼容Redis协议的数据库的经历。首先这个"Redis"是非常简单的实现&#xff0c;但是他在优化这个简单"Redis"路程很有趣&#xff0c;也能给我们在从事性能优化工作时带来一些启…

Netty 4.x – ByteBuf

2019独角兽企业重金招聘Python工程师标准>>> 1、ByteBuf与Java NIO Buffer ByteBuf则是Java NIO Buffer的新轮子&#xff0c;官方列出了一些ByteBuf的特性&#xff1a; 需要的话&#xff0c;可以自定义buffer类型&#xff1b;通过组合buffer类型&#xff0c;可实现透…