无忧启动论坛

标题: 右键加入“管理员取得所有权”选项 [打印本页]

作者: aoyabing    时间: 2020-12-27 11:05
标题: 右键加入“管理员取得所有权”选项
右键加入管理员取得所有权选项

有些软件爱好者制作的优化精简版WIN10、WIN8.1系统里,点击文件或文件夹时,鼠标右键里可能没有管理员取得所有权选项,如果要打开的是系统文件夹,此时会遭拒绝。为解决这个问题,弄了一个右键加入管理员取得所有权选项的注册表文件,现与大家分享。

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*\shell\runas]
@="管理员取得所有权"
"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\exefile\shell\runas2]
@="管理员取得所有权"
"NoWorkingDirectory"=""
[HKEY_CLASSES_ROOT\exefile\shell\runas2\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]
@="管理员取得所有权"
"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"




作者: asd2588    时间: 2020-12-27 11:50
用“右键管家”很方便
作者: aoyabing    时间: 2020-12-27 11:53
本帖最后由 aoyabing 于 2020-12-27 11:54 编辑
asd2588 发表于 2020-12-27 11:50
用“右键管家”很方便

是的,更方便些
作者: wcx8020    时间: 2020-12-27 12:04
如何使用
作者: name201926    时间: 2020-12-27 12:19
WIN7以上系统与软件兼容问题,有些操作没有管理员取得所有权,运行会出现问题。
作者: wilot    时间: 2020-12-27 12:33
学习了
作者: aoyabing    时间: 2020-12-27 12:54
本帖最后由 aoyabing 于 2020-12-27 13:10 编辑
wcx8020 发表于 2020-12-27 12:04
如何使用

复制粘贴到文本文件里,保存并命名如2.TXT,改扩展名TXT为REG,双击2.REG,选择导入即可。

用右键管家也可以解决!!!如下图。






作者: 2011_yycn    时间: 2020-12-27 13:31
右键管家
作者: zhxy9804    时间: 2020-12-27 13:58
本帖最后由 zhxy9804 于 2020-12-27 14:00 编辑

你这个是不对,也不全的
我做的这个覆盖好,没有bug,win7-win10系统通用.文件文件夹也通吃.
  1. Windows Registry Editor Version 5.00

  2. [HKEY_CLASSES_ROOT\*\shell\runas]
  3. @="管理员取得所有权"
  4. "Icon"="%windir%\\system32\\shell32.dll,111"
  5. "NoWorkingDirectory"=""

  6. [HKEY_CLASSES_ROOT\*\shell\runas\command]
  7. @="cmd.exe /c takeown /f "%1" && icacls "%1" /grant administrators:F"
  8. "IsolatedCommand"="cmd.exe /c takeown /f "%1" && icacls "%1" /grant administrators:F"

  9. [HKEY_CLASSES_ROOT\batfile\shell\runas2]
  10. @="管理员取得所有权"
  11. "Icon"="%windir%\\system32\\shell32.dll,111"
  12. "NoWorkingDirectory"=""

  13. [HKEY_CLASSES_ROOT\batfile\shell\runas2\command]
  14. @="cmd.exe /c takeown /f "%1" && icacls "%1" /grant administrators:F"
  15. "IsolatedCommand"="cmd.exe /c takeown /f "%1" && icacls "%1" /grant administrators:F"

  16. [HKEY_CLASSES_ROOT\cmdfile\shell\runas2]
  17. @="管理员取得所有权"
  18. "Icon"="%windir%\\system32\\shell32.dll,111"
  19. "NoWorkingDirectory"=""

  20. [HKEY_CLASSES_ROOT\cmdfile\shell\runas2\command]
  21. @="cmd.exe /c takeown /f "%1" && icacls "%1" /grant administrators:F"
  22. "IsolatedCommand"="cmd.exe /c takeown /f "%1" && icacls "%1" /grant administrators:F"

  23. [HKEY_CLASSES_ROOT\exefile\shell\runas2]
  24. @="管理员取得所有权"
  25. "Icon"="%windir%\\system32\\shell32.dll,111"
  26. "NoWorkingDirectory"=""

  27. [HKEY_CLASSES_ROOT\exefile\shell\runas2\command]
  28. @="cmd.exe /c takeown /f "%1" && icacls "%1" /grant administrators:F"
  29. "IsolatedCommand"="cmd.exe /c takeown /f "%1" && icacls "%1" /grant administrators:F"

  30. [HKEY_CLASSES_ROOT\Folder\shell\runas2]
  31. @="管理员取得所有权"
  32. "Icon"="%windir%\\system32\\shell32.dll,111"
  33. "NoWorkingDirectory"=""

  34. [HKEY_CLASSES_ROOT\Folder\shell\runas2\command]
  35. @="cmd.exe /c takeown /f "%1" /r /d y && icacls "%1" /grant administrators:F /t"
  36. "IsolatedCommand"="cmd.exe /c takeown /f "%1" /r /d y && icacls "%1" /grant administrators:F /t"

  37. [-HKEY_CLASSES_ROOT\Directory\shell\runas]
复制代码



作者: 韩小锐    时间: 2020-12-27 15:08
学习了
作者: aoyabing    时间: 2020-12-27 15:55
本帖最后由 aoyabing 于 2020-12-27 16:10 编辑
zhxy9804 发表于 2020-12-27 13:58
你这个是不对,也不全的
我做的这个覆盖好,没有bug,win7-win10系统通用.文件文件夹也通吃.

谢谢版主纠错!但你的导入后,我的电脑、回收站右键里都多了“管理员取得所有权”,能否更完善一下?
作者: 2048    时间: 2020-12-27 17:49
谢谢大佬的分享
作者: zhxy9804    时间: 2020-12-27 17:58
aoyabing 发表于 2020-12-27 15:55
谢谢版主纠错!但你的导入后,我的电脑、回收站右键里都多了“管理员取得所有权”,能否更完善一下?

这个目前只能这样子,就跟命令提示符一样,无伤大雅
必须folder,不能directory,
作者: 2012xuchyou    时间: 2020-12-27 19:19
用了,怎么右键上显示乱码?求解。
作者: 2011ncjxysyt    时间: 2020-12-27 21:28
zhxy9804 发表于 2020-12-27 13:58
你这个是不对,也不全的
我做的这个覆盖好,没有bug,win7-win10系统通用.文件文件夹也通吃.


用完你的右键出乱码了


作者: 2011ncjxysyt    时间: 2020-12-27 21:30
2012xuchyou 发表于 2020-12-27 19:19
用了,怎么右键上显示乱码?求解。

我和你一样,用完了右键是乱码。
作者: aoyabing    时间: 2020-12-27 21:42
本帖最后由 aoyabing 于 2020-12-27 21:47 编辑
2012xuchyou 发表于 2020-12-27 19:19
用了,怎么右键上显示乱码?求解。

谢谢反馈,建议用右键管家解决,见下图。WIN10会出现。WIN8.1正常。试试下面的
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*\Shell\TakeAuthority]
"icon"="\"C:\\windows\\system32\\SHELL32.dll,160\""
@="管理员取得所有权"
"NoWorkingDirectory"=""

[HKEY_CLASSES_ROOT\*\Shell\TakeAuthority\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\exefile\shell\TakeAuthority]
"icon"="\"C:\\windows\\system32\\SHELL32.dll,160\""
@="管理员取得所有权"

[HKEY_CLASSES_ROOT\exefile\shell\TakeAuthority\Command]
@="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"

[HKEY_CLASSES_ROOT\Directory\shell\runas]
"icon"="\"C:\\windows\\system32\\SHELL32.dll,160\""
"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"



##############或者###############

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*\shell\runas]
@="管理员取得所有权"
"NoWorkingDirectory"=""
"icon"="C:\\Windows\\system32\\SHELL32.dll,170"

[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\exefile\shell\runas2]
@="管理员取得所有权"
"NoWorkingDirectory"=""
"icon"="C:\\Windows\\system32\\SHELL32.dll,170"

[HKEY_CLASSES_ROOT\exefile\shell\runas2\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]
@="管理员取得所有权"
"NoWorkingDirectory"=""
"icon"="C:\\Windows\\system32\\SHELL32.dll,170"

[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"






作者: 2011matrixvexx    时间: 2020-12-31 11:09
感謝樓主分享,剛好正需要呢!
作者: 2011matrixvexx    时间: 2020-12-31 16:31
aoyabing 发表于 2020-12-27 21:42
谢谢反馈,建议用右键管家解决,见下图。WIN10会出现。WIN8.1正常。试试下面的
Windows Registry Editor ...

以下供參考:
我的也是如此,在 Win10 底下,
我將"管理員取得所有權"這幾個字,全部尋找/取代成繁體,簡體系統類推。
在 Notepad 儲存時,將編碼改成 ANSY 再儲存

作者: 学习怎么USB    时间: 2020-12-31 17:24
看来不错,一定用得上




欢迎光临 无忧启动论坛 (http://bbs.c3.wuyou.net/) Powered by Discuz! X3.3