在 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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 09:57:00  来源:igfitidea点击:

Alter folder permission in windows command line?

windowscmd

提问by Reza Ameri

Possible Duplicate:
How to grant permission to users for a directory using command line in Windows?

可能的重复:
如何在 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\testyou 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