Privacy and Security Change Permissions of File, Folder, Drive, or Registry Key in Windows 11

  • Thread starter Thread starter Brink
  • Start date Published: Start date Updated Updated:

Users_header.webp

This tutorial will show you different ways to change the permissions of a file, folder, drive, or registry key for specific users and groups in Windows 10 and Windows 11.

You can set permissions for registry keys, and files and folders on NTFS and ReFS volumes. These permissions allow or deny access to the files, folders, drives, and registry keys.

Every container (ex: folder) and object (ex: file) on the PC has a set of access control entry (ACE) information attached to it. Known as a security descriptor, this information controls the type of access allowed to users and groups. The security descriptor is automatically created along with the container or object that is created.

There are two types of permissions: explicit permissions and inherited permissions.
  • Explicit permissions are those that are set by default on non-child objects when the object is created, or by user action on non-child, parent or child objects. Explicit permissions take precedence over inherited permissions. Enabling or disabling inherited permissions for a file or folder will not affect explicit permissions for the file or folder.
  • Inherited permissions are those that are propagated to an object (ex: file or folder) from a parent object (ex: drive or folder). Inherited permissions ease the task of managing permissions and ensure consistency of permissions among all objects within a given container.
You can change the permissions a file, folder, drive, or registry key for specific users and groups to what you want for access control.

The following table lists the access limitations for each set of special NTFS permissions.

Special Permissions​
Full Control​
Modify​
Read & Execute​
List Folder Contents
(drives and folders only)​
Read​
Write​
Traverse Folder/Execute Filexxxx
List Folder/Read Dataxxxxx
Read Attributesxxxxx
Read Extended Attributesxxxxx
Create Files/Write Dataxxx
Create Folders/Append Dataxxx
Write Attributesxxx
Write Extended Attributesxxx
Delete Subfolders and Filesx
Deletexx
Read Permissionsxxxxxx
Change Permissionsx
Take Ownershipx
Synchronizexxxxxx

References:

You must be signed in as an administrator, current owner of object, or have "full control" permissions of object to reset the object's permissions.




Contents

  • Option One: Change Permissions of File, Folder, Drive, or Registry Key in Security Settings
  • Option Two: Change Permissions of File, Folder, Drive, or Registry Key in Advanced Security Settings
  • Option Three: Change Permissions of File, Folder, or Drive using icacls Command
  • Option Four: Change Permissions of Registry Key using Set-Acl PowerShell Command




Option One

Change Permissions of File, Folder, Drive, or Registry Key in Security Settings


1 Perform an appropriate action below: (see screenshots below)
  • In File Explorer (Win+E), right click on the file, folder, or drive you want to change permissions of, and click/tap on Properties.
  • In Registry Editor (regedit.exe), right click on a registry key you want to change permissions of, and click/tap on Permissions.
Permissions-1.webp
Permissions-2.webp

2 If this is for a file, folder, or drive, click/tap on the Security tab, and click/tap on Edit. (see screenshots below)

If you see "You must have Read permissions to view the properties of this object", then you will need to change the owner to your account first.


Permissions-3.webp
No_permissions-1.webp

3 Perform the steps below to change the permissions: (see screenshots below)
  1. Select a user or group you want to change the permissions for.
  2. Check or uncheck the Allow or Deny boxed for the simple permissions you want applied to the selected user or group.
  3. Click/tap on OK when finished changing permissions for users and groups.

You can click/tap on the Add button to add a user or group to configure permissions for this object.

You can select a user or group and click/tap on the Remove button to remove the user or group from this object's permissions.


Permissions-4.webp
Permissions-5.webp

4 Click/tap on OK. (see screenshot below)

Permissions-6.webp




Option Two

Change Permissions of File, Folder, Drive, or Registry Key in Advanced Security Settings


1 Perform an appropriate action below: (see screenshots below)
  • In File Explorer (Win+E), right click on the file, folder, or drive you want to change permissions of, and click/tap on Properties.
  • In Registry Editor (regedit.exe), right click on a registry key you want to change permissions of, and click/tap on Permissions.
Permissions-1.webp
Permissions-2.webp

2 Click/tap on the Security tab, and click/tap on the Advanced button. (see screenshots below)

If you see "You must have Read permissions to view the properties of this object", then you will need to change the owner to your account first.


Advanced_permissions-1.webp
Advanced_permissions-2.webp
No_permissions-1.webp

3 Select a user or group you want to change explicit permissions for, and click/tap on the Edit button. (see screenshots below)

You will see "Unable to display current owner" when you see "You must have Read permissions to view the properties of this object" in step 2.

To change inherited permissions, you will need to change the permissions of the parent object (ex: "D:\") instead.

You can click/tap on the Add button to add a user or group to configure permissions for this object.

You can select a user or group and click/tap on the Remove button to remove the user or group from this object's permissions.


Advanced_permissions-3.webp
Advanced_permissions-4.webp
No_permissions-2.webp

4 Select Allow or Deny in the Type drop menu for the type of permissions you want to change. (see screenshots below)

Advanced_permissions-5.webp
Advanced_permissions-6.webp
Advanced_permissions-7.webp

5 If this is for a folder, drive, or registry key, select what you want in the Applies to drop menu for how the permissions will be applied. (see screenshots below)

Advanced_permissions-8.webp
Advanced_permissions-9.webp

6 Perform the steps below to select the basic or advanced permissions you want applied: (see screenshots below)
  1. Click/tap on the Show advanced permissions or Show basic permissions link for what you want.
  2. Check or uncheck the permissions you want applied to the selected user or group for this object.
  3. Click/tap on OK when finished.
Advanced_permissions-10.webp
Advanced_permissions-11.webp
Advanced_permissions-12.webp
Advanced_permissions-13.webp
Advanced_permissions-14.webp
Advanced_permissions-15.webp

7 Click/tap on OK. (see screenshot below)

Advanced_permissions-16.webp

8 Click/tap on OK. (see screenshot below)

Advanced_permissions-17.webp




Option Three

Change Permissions of File, Folder, or Drive using icacls Command


1 Open Terminal (Admin), and select either Windows PowerShell or Command Prompt.

2 Type the command below you want to use into Terminal, and press Enter. (see table and screenshots below)

Command Prompt: Change permissions of file for user or group
icacls "<full path of file with extension>" /grant "<user or group>":(<permissions>)

OR​

PowerShell: Change permissions of file for user or group
icacls "<full path of folder>" /grant '<user or group>:(<permissions>)'

OR​

Command Prompt: Change permissions of folder for user or group
icacls "<full path of file with extension>" /grant "<user or group>":(<permissions>)

OR​

PowerShell: Change permissions of folder for user or group
icacls "<full path of folder>" /grant '<user or group>:(<permissions>)'

OR​

Command Prompt: Change permissions of folder, subfolders and files for user or group
icacls "<full path of file with extension>" /grant "<user or group>":(<permissions>) /t /c

OR​

PowerShell: Change permissions of folder, subfolders and files for user or group
icacls "<full path of folder>" /grant '<user or group>:(<permissions>)' /t /c

OR​

Command Prompt: Change permissions of drive for user or group
icacls "<drive letter>:" /grant "<user or group>":(<permissions>)

OR​

PowerShell: Change permissions of drive for user or group
icacls "<drive letter>:" /grant '<user or group>:(<permissions>)'

OR​

Command Prompt: Change permissions of drive, subfolders and files for user or group
icacls "<drive letter>:" /grant "<user or group>":(<permissions>) /t /c

OR​

PowerShell: Change permissions of drive, subfolders and files for user or group
icacls "<drive letter>:" /grant '<user or group>:(<permissions>)' /t /c

Substitute <full path of file with extension> in the commands above with the actual full path of the file with extension you want to change permissions of.

Substitute <full path of folder> in the commands above with the actual full path of the folder you want to change permissions of.

Substitute <drive letter> in the commands above with the actual drive letter (ex: "D") of the drive you want to change permissions of.

Substitute <user or group> in the commands above with the name of the user account (ex: "Brink") or group (ex: "Administrators") you want to change permissions for this object.

Substitute <permissions> in the command above with one or more basic and/or advanced permissions you want to assign to the user or group from the table below with each permission separated by a comma.

For example:

Command: icacls "D:\Folder" /grant "Administrators":(F,WO) /t /c

PowerShell: icacls "D:\Folder" /grant 'Administrators:(F,WO)' /t /c


Description​
Nno access
Ffull access
Mmodify access
RXread and execute access
Rread-only access
Wwrite-only access
Ddelete access
Description​
DEdelete
RCread control
WDACwrite DAC
WOwrite owner
Ssynchronize
ASaccess system security
MAmaximum allowed
GRgeneric read
GWgeneric write
GEgeneric execute
GAgeneric all
RDread data/list directory
WDwrite data/add file
ADappend data/add subdirectory
REAread extended attributes
WEAwrite extended attributes
Xexecute/traverse
DCdelete child
RAread attributes
WAwrite attributes

permissions_icacls_command.webp
permissions_icacls_PowerShell.webp





Option Four

Change Permissions of Registry Key using Set-Acl PowerShell Command


1 Open Terminal (Admin), and select Windows PowerShell.

2 Type the command below into Terminal, and press Enter. (see table and screenshot below)

Rich (BB code):
$acl=Get-Acl "<branch>:\<key path>";$rule=New-Object System.Security.AccessControl.RegistryAccessRule("<user or group>","<permission>","<Allow or Deny>");$acl.AddAccessRule($rule);Set-Acl "<branch>:\<key path>" $acl

Substitute <branch> in the commands above with the actual HKCR (HKEY_CLASSES_ROOT), HKCU (HKEY_CURRENT_USER), HKLM (HKEY_LOCAL_MACHINE), HKU (HKEY_USERS), or HKCC (HKEY_CURRENT_CONFIG) branch the key is in.

Substitute <key path> in the command above with the rest of the path of the registry key.

Substitute <user or group> in the command above with the name of the user account (ex: "Brink") or group (ex: "Administrators") you want to change permissions for this registry key.

Substitute <permission> in the command above with a permission you want to assign to the user or group from the table below with.

Substitute <Allow or Deny> with only Allow or Deny for which type of permission you want.

For example:


Rich (BB code):
$acl=Get-Acl "HKCU:\Control Panel\ExampleKey";$rule=New-Object System.Security.AccessControl.RegistryAccessRule("Administrators","FullControl","Allow");$acl.AddAccessRule($rule);Set-Acl "HKCU:\Control Panel\ExampleKey" $acl

Description​
ChangePermissionsThe right to change the access rules and audit rules associated with a registry key.
CreateSubKeyThe right to create subkeys of a registry key.
DeleteThe right to delete a registry key.
EnumerateSubKeysThe right to list the subkeys of a registry key.
ExecuteKeySame as ReadKey.
FullControlThe right to exert full control over a registry key, and to modify its access rules and audit rules.
NotifyThe right to request notification of changes on a registry key.
ReadKeyThe right to query the name/value pairs in a registry key, to request notification of changes, to enumerate its subkeys, and to read its access rules and audit rules
ReadPermissionsThe right to open and copy the access rules and audit rules for a registry key.
SetValueThe right to create, delete, or set name/value pairs in a registry key.
TakeOwnershipThe right to change the owner of a registry key.
WriteKeyThe right to create, delete, and set the name/value pairs in a registry key, to create or delete subkeys, to request notification of changes, to enumerate its subkeys, and to read its access rules and audit rules.

permissions_Set-Acl_PowerShell.webp



That's it,
Shawn Brink


 
Last edited:

Latest Support Threads

Back
Top Bottom