0
I am the administrator in my PC and there are some other users on it. I set a folder (Gabi) as "Read only" for a specific user (Alice), using ICACLS via the Command Prompt (I am using windows 7 in VirtualBox). The folder has some ".txt" files. I used the following command:
icacls "C:\ITSM Lab1\Administration\Gabi" /grant:r Alice:(OI)(CI)R /T
The above command ran successfully in the Command Prompt. But the files in the folder can still be modified (Alice can change the text file and can save the file as well. He can rename as well. He can even delete the whole folder with the files).
I also tried this link : Use icacls to make a directory read-only on Windows 7. I followed the link and tried the following command:
C:\Windows\system32\Icacls "C:\ITSM Lab1\Administration\Gabi" /deny "Alice": (CI)(OI)(W,D) /Grant:r "Alice":(CI)(OI)R /T
In the above command, I denied "write" and "delete" for Alice, and gave Alice "Read-only" permission. This command ran successfully, but the folder "Gabi" gets completely inaccessible and undeletable, which does not serve my purpose.
Then I restored windows 7 to the state before running the above code.
I don't know why the commands are not really setting the "read-only" permission. Actually I want to set the permission in such a way that Alice will be able to read the txt files, but won't be able to change/delete the files/folder, and he won't be able to create any new file/folder in "Gabi" folder . I just checked the permission for Alice via GUI (Security Tab): in the "Allow" column only ''Read'' is ticked (there is no other tick marks). So the GUI is showing that "read-only" permission is applied on Gabi folder. But, Alice can still change and delete those files and the folder. I don't know why.
What am I doing wrong?
Before running the first command icacls "C:\ITSM Lab1\Administration\Gabi" /grant:r Alice:(OI)(CI)R /T
, I ran the following command:
icacls "C:\ITSM Lab1\Administration\Gabi" /grant Alice:R /T
When I run the command:icacls "C:\ITSM Lab1\Administration\Gabi
I get the following result:
icacls "C:\ITSM Lab1\Administration\Gabi"
C:\ITSM Lab1\Administration\Gabi Tanvir-PC\Alice:(R)
Tanvir-PC\Alice:(OI)(CI)(R)
Tanvir-PC\Gabi:(OI)(CI)(F)
Tanvir-PC\SysAdministrator:(OI)(CI)(F)
Tanvir-PC\CEO:(OI)(CI)(F)
Tanvir-PC\Managers:(I)(OI)(CI)(N)
Tanvir-PC\SysAdministrator:(I)(OI)(CI)(F)
Tanvir-PC\CEO:(I)(OI)(CI)(F)
BUILTIN\Administrators:(I)(F)
BUILTIN\Administrators:(I)(OI)(CI)(IO)(F)
NT AUTHORITY\SYSTEM:(I)(F)
NT AUTHORITY\SYSTEM:(I)(OI)(CI)(IO)(F)
BUILTIN\Users:(I)(OI)(CI)(RX)
NT AUTHORITY\Authenticated Users:(I)(M)
NT AUTHORITY\Authenticated Users:(I)(OI)(CI)(IO)(M)
Successfully processed 1 files; Failed processing 0 files
UPDATE:
In my Windows 7 (in VirtualBox) , there are 4 local groups (which I created by command line):
Administration
CEO
Managers
SysAdministrator
Each local group has user(s) (which I created by command line):
Users in "Administration" : Alice, Gabi
Users in "CEO": Chief
Users in "Managers" : Anthony, Elisa
Users in "SysAdministrator": Admin
I ran the command C:>icacls "C:\Work place\Topics\Rasu"
The result I got for Hary is :--- C:\Work place\Topics\Rasu Kaly-PC\Hary:(R) Kaly-PC\Hary:(OI)(CI)(R) – kaly – 2017-10-15T17:23:11.260
OK. First of all, granting the (R)ead permission does not make an object (e.g. file or folder) read-only. NTFS permissions are "additive", meaning all permissions a user has are added together to determine what they can do. What is your end goal here? To make it so only a certain user (or group of users) can read but not modify this folder and its contents? – I say Reinstate Monica – 2017-10-15T18:05:43.427
1my goal is : a certain user can read but cannot do anything else – kaly – 2017-10-15T18:48:29.613