Create folder/file and set permissions

非 Y 不嫁゛ 提交于 2019-12-11 13:09:41

问题


How to in XP from command line create folder/file and after that allow everything to everyone permissions ? I tried from properties, I deselect readonly but when I open properties again for that folder/file it is always READONLY.


回答1:


You have to use "CACLS".
Use CACLS /help to have the documentation.
Here 2 exemples:
To give the full right to the user "user1" to the directory

CACLS c:\directory /E /T /C /G "user1":F

To give the full right to the user "user1" to the content of the directory

CACLS c:\directory\*.* /E /T /C /G "user1":F 



回答2:


CACLS /help:

NOTE: Cacls is now deprecated, please use Icacls.

To give the full right to the user "user1" to the directory (Nicolas' example converted):

Icacls c:\directory /T /C /grant "user1":F


来源:https://stackoverflow.com/questions/4680019/create-folder-file-and-set-permissions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!