Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am searching for a way to set permissions on folder and the contents.

The rule is as such that the only the superuser can delete contents of the folder. Users can add, view, modify, but not delete the files in the directory.

share|improve this question
6  
Which OS do you use? –  Michael K Aug 22 '12 at 9:57
1  
Are you concerned about users deleting files but not, for example, opening them up and deleting all of the contents? –  dsolimano Sep 19 '12 at 13:04
add comment

1 Answer

Use the icacls command:

icacls "%ProgramFiles(x86)%\folder" /grant "Domain Users":f /t /q

This command will grant read/write permissions to all domain users in folder and all files and subfolders in it.

Explanation:

/grant
:r  Read Access
user:permission
:f  Full access
/t  Traverse all subfolders to match files/directories.
/q  Quiet - supress success messages.
share|improve this answer
    
MAC OS X 10 Lion –  VidyaEvolution Sep 19 '12 at 11:28
    
Thank you for the solution. This will work with windows only. I am currently using Mac OS X Lion. –  VidyaEvolution Sep 19 '12 at 12:45
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.