Privacy and Security Reset Permissions of File, Folder, 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 how to reset effective permissions of a file, folder, or registry key object back to their default inherited permissions 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 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 reset the permissions of a file, folder, or registry key to default by replacing them with inherited permissions from their parent object.

This can be handy if you mistakenly made a mess of the permissions of a file, folder, or registry key, and need to quickly reset them back to default.

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.


Resetting permissions of an object does not change the owner of the object.




Contents

  • Option One: Reset Permissions of File using icacls Command
  • Option Two: Reset Permissions of Folder using icacls Command
  • Option Three: Reset Permissions of Folder, Subfolder and Files using icacls Command
  • Option Four: Reset Permissions of Registry Key using Set-Acl PowerShell Command




Option One

Reset Permissions of File using icacls Command


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

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

icacls "<full path of file with extension>" /reset

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

For example: icacls "D:\Folder\file.txt" /reset


reset_file_permisions_icacls_command.webp





Option Two

Reset Permissions of Folder using icacls Command


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

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

icacls "<full path of folder>" /reset

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

For example: icacls "D:\Folder" /reset


reset_folder_permisions_icacls_command.webp





Option Three

Reset Permissions of Folder, Subfolder and Files using icacls Command


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

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

icacls "<full path of folder>" /reset /t /c

Substitute <full path of folder> in the command above with the actual full path of the folder you want to reset permissions for the folder, subfolders and files.

For example: icacls "D:\Folder" /reset /t /c


reset_folder_subfolders_and_files_permisions_icacls_comman1.webp





Option Four

Reset 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 screenshot below)

Rich (BB code):
Set-Acl "<branch>:\<key path>" (Get-Acl (Split-Path "<branch>:\<key path>" -Parent) | ForEach-Object { $_.SetAccessRuleProtection($false,$false); $_ })

Substitute <branch> in the command 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.

For example:

Set-Acl "HKCU:\Control Panel\ExampleKey" (Get-Acl (Split-Path "HKCU:\Control Panel\ExampleKey" -Parent) | ForEach-Object { $_.SetAccessRuleProtection($false,$false); $_ })


reset_registry_key_permisions_set-acl_command.webp



That's it,
Shawn Brink


 
Last edited:

Latest Support Threads

Back
Top Bottom