在 Windows 命令行中更改文件夹权限?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12725322/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Alter folder permission in windows command line?
提问by Reza Ameri
Possible Duplicate:
How to grant permission to users for a directory using command line in Windows?
I want to grant all users of a system the permissions of read, write and modify for a folder. I think there would be a command line that I use to do that, but if there is nothing and I have to write a code for it please help me with it.
我想授予系统的所有用户对文件夹的读取、写入和修改权限。我想我会用一个命令行来做到这一点,但是如果没有任何东西并且我必须为它编写代码,请帮助我。
Main Problem is that I want to grant these permissions to all users, usually I don't care about UserNames and I want to put "*" instead of usernames, to apply new permissions for all users.
主要问题是我想将这些权限授予所有用户,通常我不关心用户名,我想用“*”代替用户名,为所有用户应用新权限。
any idea? Thanks.
任何的想法?谢谢。
回答by RB.
There isa command line - CACLS.
这里是一个命令行- CACLS。
For example, to add "Everyone" with "Full Control" to the folder c:\temp\test
you would use:
例如,要将“所有人”和“完全控制”添加到c:\temp\test
您将使用的文件夹中:
REM /t means "apply change recursively"
REM /e means "edit existing DACL".
REM Omitting this will overwrite the existing DACL.
cacls c:\temp\Test /t /e /g Everyone:f