Tweaking.com Support Forums
Main Forum => General Computer Support => Topic started by: Angelika on February 23, 2018, 04:35:13 am
-
How to modify script so that do not click on the administrator permissions each time UAC is enabled.
There are two administrators in Windows.
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"
-
I use this for my Win 7 laptop - https://www.sevenforums.com/tutorials/1911-take-ownership-shortcut.html and this one on my Win 10 laptops - https://www.tenforums.com/tutorials/3841-add-take-ownership-context-menu-windows-10-a.html
You may also find them easier to use.
-
Thanks, now it works well.
-
Good - a lot better than messing around with scripts.