mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-07-05 04:33:53 -05:00
Add "take ownership" context menu
This is not working, and I don't have enough experience to troubleshoot, so I would like some help
This commit is contained in:
@ -2546,6 +2546,38 @@
|
||||
"Disable-NetAdapterBinding -Name \"*\" -ComponentID ms_tcpip6"
|
||||
]
|
||||
},
|
||||
"WPFTweaksTakeOwnershipContextMenu": {
|
||||
"Content": "Enable Take Ownership in context menu",
|
||||
"Description": "Enables Take Ownership in file explorer context menu. Useful if windows is being fussy with external drives.",
|
||||
"category": "z__Advanced Tweaks - CAUTION",
|
||||
"panel": "1",
|
||||
"Order": "a031_",
|
||||
"InvokeScript": [
|
||||
"
|
||||
New-Item -Path \"Registry::HKCR:\\*\\shell\\runas\" -Force | Out-Null
|
||||
Set-ItemProperty -Path \"Registry::HKCR:\\*\\shell\\runas\" -Name \"(default)\" -Value 'Take Ownership'
|
||||
Set-ItemProperty -Path \"Registry::HKCR:\\*\\shell\\runas\" -Name \"NoWorkingDirectory\" -Value ''
|
||||
|
||||
New-Item -Path \"Registry::HKCR:\\*\\shell\\runas\\command\" -Force | Out-Null
|
||||
Set-ItemProperty -Path \"Registry::HKCR:\\*\\shell\\runas\\command\" -Name \"(default)\" -Value 'cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F'
|
||||
Set-ItemProperty -Path \"Registry::HKCR:\\*\\shell\\runas\\command\" -Name \"IsolatedCommand\" -Value 'cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F'
|
||||
|
||||
New-Item -Path \"Registry::HKCR:\\Directory\\shell\\runas\" -Force | Out-Null
|
||||
Set-ItemProperty -Path \"Registry::HKCR:\\Directory\\shell\\runas\" -Name \"(default)\" -Value 'Take Ownership'
|
||||
Set-ItemProperty -Path \"Registry::HKCR:\\Directory\\shell\\runas\" -Name \"NoWorkingDirectory\" -Value ''
|
||||
|
||||
New-Item -Path \"Registry::HKCR:\\Directory\\shell\\runas\\command\" -Force | Out-Null
|
||||
Set-ItemProperty -Path \"Registry::HKCR:\\Directory\\shell\\runas\\command\" -Name \"(default)\" -Value 'cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t'
|
||||
Set-ItemProperty -Path \"Registry::HKCR:\\Directory\\shell\\runas\\command\" -Name \"IsolatedCommand\" -Value 'cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t'
|
||||
"
|
||||
],
|
||||
"UndoScript": [
|
||||
"
|
||||
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue -Path \"Registry::HKCR:\\*\\shell\\runas\"
|
||||
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue -Path \"Registry::HKCR:\\Directory\\shell\\runas\"
|
||||
"
|
||||
]
|
||||
},
|
||||
"WPFToggleDarkMode": {
|
||||
"Content": "Dark Theme",
|
||||
"Description": "Enable/Disable Dark Mode.",
|
||||
|
Reference in New Issue
Block a user