南瓜园

 找回密码
 注册
查看: 981|回复: 0

利用注册表获取Win8管理员权限

[复制链接]
发表于 2017-5-9 11:16:16 | 显示全部楼层 |阅读模式
新建记事本将下面的代码复制并保存,将记事本文件扩展名改为.reg。双击这个文件导入注册表,导入前会有提示让你选择,点【是】。导入进去之后,右击你要取得权限的文件夹,鼠标右键菜单中选择【管理员权限】即可。
当然了,你也可以恢复成默认权限,此时在右键菜单中选择恢复原始权限就行了。
1、取得管理员权限
Windows Registry Editor Version 5.00;取得文件修改权限
[HKEY_CLASSES_ROOT*shellrunas]
@="管理员权限"
"Icon"="C:\Windows\System32\imageres.dll,102"
"NoWorkingDirectory"=""
[HKEY_CLASSES_ROOT*shellrunascommand]
@="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_ROOTexefileshellrunas2]
@="管理员权限"
"Icon"="C:\Windows\System32\imageres.dll,102"
"NoWorkingDirectory"=""
[HKEY_CLASSES_ROOTexefileshellrunas2command]
@="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_ROOTDirectoryshellrunas]
@="管理员权限"
"Icon"="C:\Windows\System32\imageres.dll,102"
"NoWorkingDirectory"=""
[HKEY_CLASSES_ROOTDirectoryshellrunascommand]
@="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"
2、恢复原始权限:
Windows Registry Editor Version 5.00
;恢复原始权限
[HKEY_CLASSES_ROOT*shellrunas-]
@="恢复原始权限"
"Icon"="C:\Windows\System32\imageres.dll,101"
"NoWorkingDirectory"=""; && takeown /f "%1"
[HKEY_CLASSES_ROOT*shellrunas-command]
@="cmd.exe /c takeown /f "%1" && icacls "%1" /reset && cacls "%1" /e /r "%%USERNAME%%""
"IsolatedCommand"="cmd.exe /c takeown /f "%1" && icacls "%1" /reset && cacls "%1" /e /r "%%USERNAME%%""
[HKEY_CLASSES_ROOTexefileshellrunas2-]
@="恢复原始权限"
"Icon"="C:\Windows\System32\imageres.dll,101"
"NoWorkingDirectory"=""
[HKEY_CLASSES_ROOTexefileshellrunas2-command]
@="cmd.exe /c takeown /f "%1" && icacls "%1" /reset && cacls "%1" /e /r "%%USERNAME%%""
"IsolatedCommand"="cmd.exe /c takeown /f "%1" && icacls "%1" /reset && cacls "%1" /e /r "%%USERNAME%%""
[HKEY_CLASSES_ROOTDirectoryshellrunas-]
@="恢复原始权限"
"Icon"="C:\Windows\System32\imageres.dll,101"
"NoWorkingDirectory"=""
[HKEY_CLASSES_ROOTDirectoryshellrunas-command]
@="cmd.exe /c takeown /f "%1" /r /d y && icacls "%1" /reset && cacls "%1" /e /r "%%USERNAME%%""
"IsolatedCommand"="cmd.exe /c takeown /f "%1" /r /d y && icacls "%1" /reset && cacls "%1"
您需要登录后才可以回帖 登录 | 注册

本版积分规则

请大家牢记南瓜园网址 www.nan2008.com

QQ|小黑屋|手机版|Archiver|南瓜园

GMT+8, 2024-11-19 19:23 , Processed in 0.135497 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表