Takeown command fails with Access Denied message

So you wanted to take ownership over some files and the Takeown command failed with 'Access Denied' message. You have already checked if the file is open by another user or some hung process. You are loged in with the user who has the highest possible privileges on the system. Well, almost… There is one more thing you can try - running Takeown command as a system account.The simpler way to do this is to download PsTools from Microsoft.

Unpack the archive, open an elevated CMD in that folder and run psexec

psexec -i -s -d cmd.exe

This will open a new CMD window (in the C:\WINDOWS\system32 folder) using a SYSTEM account (-s), in interactive mode (-i), and will not wait for the process to finish executing (-d)

In this new window, you can use Takeown to finish the job.

Takeown /F c:\folder\file.ext /A
icacls "c:\folder" /reset /t /q
icacls "c:\folder" /grant administrators:F /T

This will take ownership of the specified file, but it will set local Administrators group as the new owner.

, 2021-02-23 18:32
Nope. Same as every other thing I've tried to delete a file that seems to have no permissions on it. "ERROR: Access is denied."
, 2021-03-01 11:14, 2021-03-01 11:17
Which version of Windows did You try this on? Perhaps the described procedure isn't valid for newer builds of Windows 10.
Also, try this tool:
Enter your comment:
H S H​ D᠎ K
  • windows/misc/takeown_fail.txt
  • Last modified: 2021-03-01 11:10
  • (external edit)