Take ownership of files on Windows

takeown /R /A /F foldername /D N
icacls foldername /grant Administrators:F /T /C

In order to be able to take ownership over certain files, import the following into registry:

Windows Registry Editor Version 5.00

@="Take Ownership"

@="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"
"IsolatedCommand"="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"

@="Take Ownership"

@="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t"
"IsolatedCommand"="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t"
Enter your comment:
112 -4 = 
  • windows/client_os/take_own.txt
  • Last modified: 2020-01-27 12:09
  • (external edit)