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

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

Administrator_banner.webp

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

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

The owner controls how permissions are set on the object (ex: file, folder, drive, or registry key) and to whom (ex: user or group) permissions are granted.

An owner is assigned to an object when that object is created. By default, the owner is the creator of the object. No matter what permissions are set on an object, the owner of the object can always change the permissions.

References:

You must be signed in as an administrator, current owner, or have "full control" permissions to change the owner of a file, folder, drive, or registry key.


Do not change the owner of the Windows drive to avoid breaking Windows.




Contents

  • Option One: Change Owner of File, Folder, or Drive using Context Menu
  • Option Two: Change Owner of File, Folder, Drive, or Registry Key in Advanced Security Settings
  • Option Three: Change Owner of File, Folder, or Drive using takeown Command
  • Option Four: Change Owner of File, Folder, or Drive using icacls Command
  • Option Five: Change Owner of File, Folder, or Drive using Set-Acl PowerShell Command
  • Option Six: Change Owner of Registry Key using Set-Acl PowerShell Command




Option One

Change Owner of File, Folder, or Drive using Context Menu


1 Add the Change Owner context menu if you haven't already. (see screenshots below)

You will need to click/tap on Show more options first by default, then click/tap on Change Owner.



Show_more_options.webp
Change_Owner_context_menu.webp




Option Two

Change Owner 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 or folder you want to change the owner of, and click/tap on Properties.
  • In Registry Editor (regedit.exe), right click on a registry key you want to change the owner of, and click/tap on Permissions.
Change_Owner-1.webp
Change_Owner-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 will need to change the owner to your account at step 5.


Change_Owner-3.webp
Change_Owner-4.webp
Change_Owner-5.webp

3 Click/tap on the Change Owner link. (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.


Change_Owner-6.webp
Change_Owner-7.webp

4 Perform an action you want below: (see screenshot below)
  • If you want to select a specific user or group as the owner, click/tap on the Advanced button.
  • If you want to set Administrators as the owner, type Administrators in the "Enter the object name to select" box, click/tap on Check Names, and skip to step 6.
  • If you want to set TrustedInstaller as the owner, type NT SERVICE\TrustedInstaller in the "Enter the object name to select" box, click/tap on Check Names, and skip to step 6.
Change_Owner-8.webp

5 Perform the steps below to select a user or group as the owner of this object: (see screenshots below)
  1. Click/tap on the Find Now button.
  2. Under "Search results" select a user or group in the 'Name" column you want as the owner.
  3. Click/tap on OK.
Change_Owner-9.webp
Change_Owner-10.webp

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

Change_Owner-11.webp

7 If this object is a folder, drive, or registry key, then check or uncheck Replace owner on subcontainers and objects for what you want. (see screenshot below)

If you check Replace owner on subcontainers and objects, it will also change the owner of all subkeys, or subfiles and subfolders in this object.


Change_Owner-12.webp

8 Click/tap on Yes to confirm if prompted. (see screenshot below)

Change_Owner-14.webp

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

Change_Owner-15.webp




Option Three

Change Owner of File, Folder, or Drive using takeown 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 screenshot below)

Change owner of file to current user
takeown /f "<full path of file with extension>"

OR​

Change owner of file to Administrators
takeown /f "<full path of file with extension>" /a

OR​

Change owner of folder or drive to current user
takeown /f "<full path of folder or drive>"

OR​

Change owner of folder or drive to Administrators
takeown /f "<full path of folder or drive>" /a

OR​

Change owner of folder or drive, subfolders and files to current user
takeown /f "<full path of folder or drive>" /r /d y

OR​

Change owner of folder or drive, subfolders and files to Administrators
takeown /f "<full path of folder or drive>" /a /r /d y

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 the owner of.

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

For example:

File: takeown /f "D:\Folder\File.txt"

Folder only: takeown /f "D:\Folder"

Folder and subfolders and files: takeown /f "D:\Folder" /r /d y

Drive only: takeown /f "D:"

Drive and subfolders and files: takeown /f "D:" /r /d y


takeown_command.webp





Option Four

Change Owner 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 screenshot below)

Change owner of file to specific user or group
icacls "<full path of file with extension>" /setowner "<user or group>" /t /c

OR​

Change owner of file to Administrators
icacls "<full path of file with extension>" /setowner "Administrators" /t /c

OR​

Change owner of file to TrustedInstaller
icacls "<full path of file with extension>" /setowner "NT SERVICE\TrustedInstaller" /t /c

OR​

Change owner of folder or drive to specific user or group
icacls "<full path of folder or drive>" /setowner "<user or group>" /c

OR​

Change owner of folder or drive to Administrators
icacls "<full path of folder or drive>" /setowner "Administrators" /c

OR​

Change owner of folder or drive to TrustedInstaller
icacls "<full path of folder or drive>" /setowner "NT SERVICE\TrustedInstaller" /c

OR​

Change owner of folder or drive, subfolders and files to specific user or group
icacls "<full path of folder or drive>" /setowner "<user or group>" /t /c

OR​

Change owner of folder or drive, subfolders and files to Administrators
icacls "<full path of folder or drive>" /setowner "Administrators" /t /c

OR​

Change owner of folder or drive, subfolders and files to TrustedInstaller
icacls "<full path of folder or drive>" /setowner "NT SERVICE\TrustedInstaller" /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 the owner of.

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

Substitute <user or group> in the commands above with the name of the user account (ex: "Brink") or group (ex: "Administrators") you want as the owner.

For example:

File: icacls "D:\Folder\File.txt" /setowner "Administrators" /t /c

Folder only: icacls "D:\Folder" /setowner "Administrators" /c

Folder and subfolders and files: icacls "D:\Folder" /setowner "Administrators" /t /c

Drive only: icacls "D:" /setowner "Administrators" /c

Drive and subfolders and files: icacls "D:" /setowner "Administrators" /c


icacls_command.webp





Option Five

Change Owner of File, Folder, or Drive using Set-Acl PowerShell Command



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

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

Change owner of file to specific user or group
Rich (BB code):
Set-Acl -Path "<full path of file with extension>" -AclObject (Get-Acl "<full path of file with extension>" | ForEach-Object { $_.SetOwner([System.Security.Principal.NTAccount]" "<user or group>"); $_ })

OR​

Change owner of file to Administrators
Rich (BB code):
Set-Acl -Path "<full path of file with extension>" -AclObject (Get-Acl "<full path of file with extension>" | ForEach-Object { $_.SetOwner([System.Security.Principal.NTAccount]" "Administrators"); $_ })

OR​

Change owner of file to TrustedInstaller
Rich (BB code):
Set-Acl -Path "<full path of file with extension>" -AclObject (Get-Acl "<full path of file with extension>" | ForEach-Object { $_.SetOwner([System.Security.Principal.NTAccount]" "NT SERVICE\TrustedInstaller"); $_ })

OR​

Change owner of folder or drive to specific user or group
Rich (BB code):
Set-Acl -Path "<full path of folder or drive>" -AclObject (Get-Acl "<full path of folder or drive>" | ForEach-Object { $_.SetOwner([System.Security.Principal.NTAccount]" "<user or group>"); $_ })

OR​

Change owner of folder or drive to Administrators
Rich (BB code):
Set-Acl -Path "<full path of folder or drive>" -AclObject (Get-Acl "<full path of folder or drive>" | ForEach-Object { $_.SetOwner([System.Security.Principal.NTAccount]" "Administrators"); $_ })

OR​

Change owner of folder or drive to TrustedInstaller
Rich (BB code):
Set-Acl -Path "<full path of folder or drive>" -AclObject (Get-Acl "<full path of folder or drive>" | ForEach-Object { $_.SetOwner([System.Security.Principal.NTAccount]" "NT SERVICE\TrustedInstaller"); $_ })

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 the owner of.

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

Substitute <user or group> in the commands above with the name of the user account (ex: "Brink") or group (ex: "Administrators") you want as the owner.

For example:

File: Set-Acl -Path "D:\Folder\File.txt" -AclObject (Get-Acl "D:\Folder\File.txt" | ForEach-Object { $_.SetOwner([System.Security.Principal.NTAccount]" "Administrators"); $_ })

Folder only: Set-Acl -Path "D:\Folder" -AclObject (Get-Acl "D:\Folder" | ForEach-Object { $_.SetOwner([System.Security.Principal.NTAccount]" "Administrators"); $_ })

Drive only: Set-Acl -Path D:" -AclObject (Get-Acl "D:" | ForEach-Object { $_.SetOwner([System.Security.Principal.NTAccount]" "Administrators"); $_ })


Change_Owner_PowerShell-1.webp





Option Six

Change Owner of Registry Key using Set-Acl PowerShell Command



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

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

Change owner of registry key to specific user or group
Set-Acl -"<branch>:\<key path>"; $acl.SetOwner([System.Security.Principal.NTAccount]"<user or group>"); Set-Acl "<branch>:\<key path>" $acl

OR​

Change owner of registry key to Administrators
Set-Acl -"<branch>:\<key path>"; $acl.SetOwner([System.Security.Principal.NTAccount]"Administrators"); Set-Acl "<branch>:\<key path>" $acl

OR​

Change owner of registry key to TrustedInstaller
Set-Acl -"<branch>:\<key path>"; $acl.SetOwner([System.Security.Principal.NTAccount]"NT SERVICE\TrustedInstaller"); 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 commands 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 as the owner.

For example:

Set-Acl -"HKCU:\Control Panel\ExampleKey"; $acl.SetOwner([System.Security.Principal.NTAccount]"Administrators"); Set-Acl "HKCU:\Control Panel\ExampleKey" $acl


Change_Owner_PowerShell-2.webp



That's it,
Shawn Brink


 

Attachments

  • Change_Owner-13.webp
    Change_Owner-13.webp
    27.8 KB · Views: 1
Last edited:

Latest Support Threads

Back
Top Bottom