Copy permissions from one Windows Folder to another
I need to create a small C# Windows app which copies security permissions from one folder to another. That includes copying group permissions too. What would be the best way to approach such a challenge?
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.