简体   繁体   English

如何限制文件被移动到Win10中的另一个文件夹?

[英]How to restrict files to being moved to another folder in win10?

Good day, I need to find out a way how to disable for win10 user to move specific file or files from specific folder . 美好的一天,我需要找出一种方法来禁止 win10 用户移动特定文件特定文件夹中的文件 How this can be done for example with batch script code or there is another way how to do it? 例如,如何使用批处理脚本代码完成此操作,或者还有另一种方法? I appreciate to see solution in any program language , that can help me with. 我很高兴看到以任何程序语言提供的解决方案 ,可以为我提供帮助。

Another obstacle would be, what if I want to restrict to move files from system folders like "C:\\Windows\\System32" path which is under administrator rights, and I suppose the person I will restrict can use those rights and move files. 另一个障碍是,如果我想限制从系统文件夹(如“ C:\\ Windows \\ System32”)中的文件移动文件,该文件位于管理员权限下,并且我想限制的人可以使用这些权限来移动文件。

I suppose too, that files I want to restrict to move, will OS often use and I won't to disable access to that files even for operation system, or any software in pc that needs it. 我也想,我想限制移动的文件操作系统会经常使用它,即使操作系统或PC中需要此文件的任何软件,我也不会禁止对该文件的访问。 Or another example, if you want to restrict hosts file to move, but browser would often look into it on startup or when hosts file content changed. 再举一个例子,如果您想限制主机文件的移动,但是浏览器经常在启动时或主机文件内容更改时查看它。

I did not actually find anything relevant, but only how to lock folder, but I think that's not the thing I need. 我实际上没有找到任何相关的内容,而是找到了如何锁定文件夹的内容,但是我认为这不是我所需要的。 Is it possible to do it, to restrict system files being moved? 是否可以这样做,以限制移动系统文件? Do I need to work with Registry Editor? 我需要使用注册表编辑器吗?

If you are looking to solve this by writing a program, I think the tool you are looking for is icacls (part of win10). 如果您想通过编写程序来解决此问题,那么我认为您正在寻找的工具是icacls (win10的一部分)。

The docs for this command are at https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/icacls 此命令的文档位于https://docs.microsoft.com/zh-cn/windows-server/administration/windows-commands/icacls

If you aren't looking to do a ton at once, however, I recommend right-clicking on the file and choosing "Properties" from the menu. 但是,如果您不想一次做很多事情,我建议右键单击该文件,然后从菜单中选择“属性”。 From there, click on the "Security" tab. 从那里,单击“安全性”选项卡。 This will give you a way to change permissions on a file or directory by hand. 这将为您提供一种手动更改文件或目录权限的方法。 More instructions for the manual solution here: https://support.microsoft.com/en-us/help/325361/how-to-configure-security-for-files-and-folders-on-a-network-in-window#2 此处提供有关手动解决方案的更多说明: https : //support.microsoft.com/zh-cn/help/325361/how-to-configure-security-for-files-and-folders-on-a-network-in-窗口#2

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM