Even if you log in as an Administrator, you do not automatically have full control over every file. System files (like C:\Windows\System32 ) are owned by NT SERVICE\TrustedInstaller . If you aren't TrustedInstaller, Windows blocks you. This prevents malware or clumsy users from deleting critical OS files and crashing the computer.
takeown /f "C:\Path\to\file.txt" icacls "C:\Path\to\file.txt" /grant YourUsername:F
This utility is built into Windows and is ideal for scripting or use in Windows Recovery Environment (WinRE).
Even if you log in as an Administrator, you do not automatically have full control over every file. System files (like C:\Windows\System32 ) are owned by NT SERVICE\TrustedInstaller . If you aren't TrustedInstaller, Windows blocks you. This prevents malware or clumsy users from deleting critical OS files and crashing the computer.
takeown /f "C:\Path\to\file.txt" icacls "C:\Path\to\file.txt" /grant YourUsername:F windows take ownership
This utility is built into Windows and is ideal for scripting or use in Windows Recovery Environment (WinRE). Even if you log in as an Administrator,