windows:client_os:take_own

Differences

This shows you the differences between two versions of the page.


windows:client_os:take_own [2020/01/27 12:09] (current) – created - external edit 127.0.0.1
Line 1: Line 1:
 +====== Take ownership of files on Windows ======
 +<code>
 +takeown /R /A /F foldername /D N
 +icacls foldername /grant Administrators:F /T /C
 +</code>
  
 +In order to be able to take ownership over certain files, import the following into registry:
 +<code>
 +Windows Registry Editor Version 5.00
 +
 +[HKEY_CLASSES_ROOT\*\shell\runas]
 +@="Take Ownership"
 +"NoWorkingDirectory"=""
 +
 +[HKEY_CLASSES_ROOT\*\shell\runas\command]
 +@="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"
 +"IsolatedCommand"="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"
 +
 +[HKEY_CLASSES_ROOT\Directory\shell\runas]
 +@="Take Ownership"
 +"NoWorkingDirectory"=""
 +
 +[HKEY_CLASSES_ROOT\Directory\shell\runas\command]
 +@="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"
 +</code>
  • windows/client_os/take_own.txt
  • Last modified: 2020/01/27 12:09
  • by 127.0.0.1