takeown /f "C:\path\file.txt" icacls "C:\path\file.txt" /grant administrators:F This is safer and immediate.
Here’s how to — though note that using Registry for this is uncommon and risky. Normally, you’d use takeown + icacls in Command Prompt. how to take ownership of file windows 11 in registry
But if you specifically need to do it via Registry (e.g., to modify system file ownership settings), here’s the correct approach: The Windows Registry does not directly store file/folder ownership . Instead, ownership is a filesystem NTFS permission, managed by the Security Account Manager (SAM) and kernel. takeown /f "C:\path\file