1 Windows Registry Editor Version 5.00 2 3 ;取得文件修改权限 4 5 [HKEY_CLASSES_ROOT\*\shell\runas] 6 7 @="管理员权限" 8 9 "Icon"="C:\\Windows\\System32\\imageres.dll,102"10 11 "NoWorkingDirectory"=""12 13 [HKEY_CLASSES_ROOT\*\shell\runas\command] 14 15 @="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"16 17 "IsolatedCommand"="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"18 19 [HKEY_CLASSES_ROOT\exefile\shell\runas2] 20 21 @="管理员权限"22 23 "Icon"="C:\\Windows\\System32\\imageres.dll,102"24 25 "NoWorkingDirectory"=""26 27 [HKEY_CLASSES_ROOT\exefile\shell\runas2\command] 28 29 @="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"30 31 "IsolatedCommand"="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"32 33 [HKEY_CLASSES_ROOT\Directory\shell\runas] 34 35 @="管理员权限"36 37 "Icon"="C:\\Windows\\System32\\imageres.dll,102"38 39 "NoWorkingDirectory"=""40 41 [HKEY_CLASSES_ROOT\Directory\shell\runas\command] 42 43 @="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t"44 45 "IsolatedCommand"="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t"
将上面的代码保存在reg格式,然后执行添加到注册列表