bestbuildpc: Forums
 

 Forum FAQForum FAQ   SearchSearch   UsergroupsUsergroups   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Add Take Ownership to Context Menu in Windows 11
 
 
Post new topic   Reply to topic    bestbuildpc Forum Index -> Tutorials/Manuals/Tricks
View previous topic :: View next topic  
Author Message
bestbuildpc
Site Admin
Site Admin


Joined: Jun 30, 2012
Posts: 213
Location: NL

PostPosted: Wed Feb 08, 2023 17:50    Post subject: Add Take Ownership to Context Menu in Windows 11 Reply with quote

This tutorial will show you how to add Take Ownership to the context menu of all files, folders, and drives for all users in Windows 11.

This will allow you to be able to instantly take ownership of a file, folder (and all contents), or drive (and all contents) by changing the owner to the current user and grant the Owner_Rights SID (for current owner) full access permission.

When you right click or press and hold on a file, folder, or drive, click/tap on Show more options, and click/tap on Take Ownership, you will be prompted by UAC for approval first.

If a user is signed in as an administrator, then the user would just click/tap on Yes to approve and take ownership. The owner of the file, folder, or drive would be changed to the current user account. Permissions would be set to allow this current owner (Owner_Rights SID) full control of the file, folder, or drive.

If a user is signed in as a standard user, then the user would need to enter a selected administrator's password to approve and take ownership. The owner of the file, folder, or drive would be changed to the selected administrator account and not the standard user. Permissions would be set to allow this current owner (Owner_Rights SID) full control of the file, folder, or drive.

The Take Ownership context menu will not be available when you right click or press and hold only on the specific C: drive, C:\Program Files folder, C:\Program Files (x86) folder, C:\ProgramData folder, C:\Users folder, and C:\Windows folder. This was done by design since taking ownership of the Windows "C:" drive and these specific system folders can make Windows unstable as it would also take ownership of all their content at the same time.

You will still be able to use the Take Ownership context menu on files and folders inside the locations above, and on all drives other than the C drive and FAT32 drives.

Application files (ex: EXE, CMD, MSI) will have the Take Ownership context menu without replacing Run as administrator.

You must be signed in as an administrator to add, remove, and use the "Take Ownership" context menu.

Taking Ownership of a FAT32 drive will not work and you will get an error indicating so since file permissions are only supported on NTFS and ReFS drives.

If you would like to have a custom location(s) of your own to not show the context menu for, then please feel free to post a request in this tutorial thread. I'll be happy to post back with a custom .reg file for it.

This context menu will only work with English Windows 11 installations. If you have a different language, then please post a reply with what language you have instead. I'll be happy to post back a translated version for you.
  
Back to top
View user's profile Send private message Visit poster's website
bestbuildpc
Site Admin
Site Admin


Joined: Jun 30, 2012
Posts: 213
Location: NL

PostPosted: Wed Feb 08, 2023 19:18    Post subject: Reply with quote

(Contents of REG file for reference)

Code:
Windows Registry Editor Version 5.00


[-HKEY_CLASSES_ROOT\*\shell\TakeOwnership]
[-HKEY_CLASSES_ROOT\*\shell\runas]

[HKEY_CLASSES_ROOT\*\shell\TakeOwnership]
@="Take Ownership"
"Extended"=-
"HasLUAShield"=""
"NoWorkingDirectory"=""
"NeverDefault"=""

[HKEY_CLASSES_ROOT\*\shell\TakeOwnership\command]
@="powershell -windowstyle hidden -command \"Start-Process cmd -ArgumentList '/c takeown /f \\\"%1\\\" && icacls \\\"%1\\\" /grant *S-1-3-4:F /t /c /l' -Verb runAs\""
"IsolatedCommand"= "powershell -windowstyle hidden -command \"Start-Process cmd -ArgumentList '/c takeown /f \\\"%1\\\" && icacls \\\"%1\\\" /grant *S-1-3-4:F /t /c /l' -Verb runAs\""


[HKEY_CLASSES_ROOT\Directory\shell\TakeOwnership]
@="Take Ownership"
"AppliesTo"="NOT (System.ItemPathDisplay:=\"C:\\Users\" OR System.ItemPathDisplay:=\"C:\\ProgramData\" OR System.ItemPathDisplay:=\"C:\\Windows\" OR System.ItemPathDisplay:=\"C:\\Windows\\System32\" OR System.ItemPathDisplay:=\"C:\\Program Files\" OR System.ItemPathDisplay:=\"C:\\Program Files (x86)\")"
"Extended"=-
"HasLUAShield"=""
"NoWorkingDirectory"=""
"Position"="middle"

[HKEY_CLASSES_ROOT\Directory\shell\TakeOwnership\command]
@="powershell -windowstyle hidden -command \"Start-Process cmd -ArgumentList '/c takeown /f \\\"%1\\\" /r /d y && icacls \\\"%1\\\" /grant *S-1-3-4:F /t /c /l /q' -Verb runAs\""
"IsolatedCommand"="powershell -windowstyle hidden -command \"Start-Process cmd -ArgumentList '/c takeown /f \\\"%1\\\" /r /d y && icacls \\\"%1\\\" /grant *S-1-3-4:F /t /c /l /q' -Verb runAs\""


[HKEY_CLASSES_ROOT\Drive\shell\runas]
@="Take Ownership"
"Extended"=-
"HasLUAShield"=""
"NoWorkingDirectory"=""
"Position"="middle"
"AppliesTo"="NOT (System.ItemPathDisplay:=\"C:\\\")"

[HKEY_CLASSES_ROOT\Drive\shell\runas\command]
@="cmd.exe /c takeown /f \"%1\\\" /r /d y && icacls \"%1\\\" /grant *S-1-3-4:F /t /c"
"IsolatedCommand"="cmd.exe /c takeown /f \"%1\\\" /r /d y && icacls \"%1\\\" /grant *S-1-3-4:F /t /c"
  
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic    bestbuildpc Forum Index -> Tutorials/Manuals/Tricks All times are GMT + 2 Hours
 
 Page 1 of 1

 

Jump to:   
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Powered by phpBB © 2001-2008 phpBB Group
 
Forums ©