I need to write a small Windows software (using VisualBasic PL) to create automatically folder trees, following a fixed structure; in particular, I have to create the main folder with several subfolders, each one with different permissions from the others (I already know which permission I may assign, for each subfolder, to each users group; all contained in the same domain).
In order to replicate the existing permission structure (not created by me, so cannot be modified), I have to edit the following section of the Security
tab of Folder Properties
:
After several researches, I found that the command I should use is icacls
(since I'm in a domain network, I will probably have to use Powershell instead of CMD, could you please explain me about this?) and so I've tried to use this command in order to assign permissions (the following tryout concerns in giving full access to the guest user for a certain folder):
icacls "C:\Users\Administrator\Desktop\prova\Folder" /grant DELL-XPS\prova:F
At the beginning, I thought the command wasn't properly working but I suddently realised that the edited permissions were the ones in the Advanced
section, reachable from the button in the previous picture.
How can I edit, through command line (CMD or PowerShell) the permissions in the red section of the picture?