Take Ownership of Windows Folders

Take Ownership of Windows Folders

Can Be Used for Deleting windows folder

Delete Windows Folder

 

DELETE WINDOWS

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

FOR WINDOWS 7

1.reg

 

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 administrateurs: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 administrateurs:F /t”
“IsolatedCommand”=”cmd.exe /c takeown /f \”%1\” /r /d y && icacls \”%1\” /grant administrateurs:F /t”

;dimm ok
;eng administrators

;French
;administrateurs
;ENG administrators

 

 

FOR WINDOWS 10

 



Windows Registry Editor Version 5.00

; Created by: Shawn Brink
; Created on: January 28th 2015
; Modified on: August 29th 2016
; Tutorial: http://www.tenforums.com/tutorials/3841-take-ownership-add-context-menu-windows-10-a.html

[-HKEY_CLASSES_ROOT\*\shell\runas]

[HKEY_CLASSES_ROOT\*\shell\runas]
@="Take Ownership"
"HasLUAShield"=""
"NoWorkingDirectory"=""
"Position"="middle"

[HKEY_CLASSES_ROOT\*\shell\runas\command]
@="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant *S-1-3-4:F /c /l"
"IsolatedCommand"="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant *S-1-3-4:F /c /l"

[-HKEY_CLASSES_ROOT\Directory\shell\runas]

[HKEY_CLASSES_ROOT\Directory\shell\runas]
@="Take Ownership"
"AppliesTo"="NOT (System.ItemPathDisplay:=\"C:\\Users\" OR System.ItemPathDisplay:=\"C:\\ProgramData\" OR System.ItemPathDisplay:=\"C:\\Windows\" OR System.ItemPathDisplay:=\"C:\\Windows\\System32\" OR System.ItemPathDisplay:=\"C:\\Program Files\" OR System.ItemPathDisplay:=\"C:\\Program Files (x86)\")"
"HasLUAShield"=""
"NoWorkingDirectory"=""
"Position"="middle"

[HKEY_CLASSES_ROOT\Directory\shell\runas\command]
@="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant *S-1-3-4:F /t /c /l /q"
"IsolatedCommand"="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant *S-1-3-4:F /t /c /l /q"

[-HKEY_CLASSES_ROOT\dllfile\shell\runas]

[HKEY_CLASSES_ROOT\dllfile\shell\runas]
@="Take Ownership"
"HasLUAShield"=""
"NoWorkingDirectory"=""
"Position"="middle"

[HKEY_CLASSES_ROOT\dllfile\shell\runas\command]
@="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant *S-1-3-4:F /c /l"
"IsolatedCommand"="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant *S-1-3-4:F /c /l"

[-HKEY_CLASSES_ROOT\Drive\shell\runas]

[HKEY_CLASSES_ROOT\Drive\shell\runas]
@="Take Ownership"
"AppliesTo"="NOT C:"
"HasLUAShield"=""
"NoWorkingDirectory"=""
"Position"="middle"

[HKEY_CLASSES_ROOT\Drive\shell\runas\command]
@="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant *S-1-5-32-544:F /t /c /l /q"
"IsolatedCommand"="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant *S-1-3-4:F /t /c /l /q"
[-HKEY_CLASSES_ROOT\exefile\shell\runas]

[HKEY_CLASSES_ROOT\exefile\shell\runas]
"HasLUAShield"=""

[HKEY_CLASSES_ROOT\exefile\shell\runas\command]
@="\"%1\" %*"
"IsolatedCommand"="\"%1\" %*"





Delete “Windows.old” Folder in Elevated Command Prompt
1. Open an elevated command prompt.

2. In the elevated command prompt, copy and paste the commands below, and press Enter after each one. (see screenshot below)

Note   Note
If you had another say windows.old.(1) folder that you also wanted to delete, then you could repeat these commands substituting that name instead of windows.old to also delete it.

attrib -r -a -s -h C:\Windows.old /S /D

RD /S /Q %SystemDrive%\windows.old

Leave a comment

Your email address will not be published. Required fields are marked *