Copy permissions from one Windows Folder to another

♀尐吖头ヾ 提交于 2019-12-05 10:47:32

First get out the folder with DirectoryInfo then get out an instance of the DirectorySecurity class using the GetAccessControl method. Then you'll be able to call GetAccessRules and AddAccessRule which should hopefully get you started.

Rather than writing the whole thing yourself, why don't you get your app to run a tool like AccessChk (use the -l parameter), and then apply permissions to the target folder based on the info you parse from the output of AccessChk.

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