Reputation: 1316
Im looking for some help on a batch file for managing NTFS permissions through a batch file.
I have created a folder containing several subfolders. The main folder is shared through NET SHARE command and is working. Now I need to set NTFS permission through command-line commands in batch file.
I need to remove access for any users except admin and a specific user.
i can add the specific user through ICACLS C:\bruger2\jesper /grant:r jesper:f
but the remove part wont work
ICACLS c:\bruger2\jesper /remove Users
Upvotes: 0
Views: 4992
Reputation: 1316
Nvm guys, I found the answer.
I needed to include /inheritance:r to remove inherited NTFS permissions
ICACLS C:\bruger\jesper /inheritance:r /grant:r jesper:f Holms:f
Upvotes: 1