关于修改hosts文件权限 Ytc[ kp
n;Mk\*Cg
修改hosts文件需要管理员权限,下列代码复制到记事本另存为reg文件后执行,可在文件右键添加“管理员取得所有权”选项,非常有用。 4"|3pMr
T}{zh
Windows Registry Editor Version 5.00 rI\5djiYJ
)^8[({r~
[HKEY_CLASSES_ROOT*shellrunas] +@uA
@="管理员取得所有权" lV:feX
"NoWorkingDirectory"="" #do%u"q
p5qfv>E8)
[HKEY_CLASSES_ROOT*shellrunascommand] W;8A{3q%N0
@="cmd.exe /c takeown /f "%1" && icacls "%1" /grant administrators:F" ^>%.l'1/(
"IsolatedCommand"="cmd.exe /c takeown /f "%1" && icacls "%1" /grant administrators:F" ,FP0n
i`52tH y_
[HKEY_CLASSES_ROOTexefileshellrunas2] hlreeXv
@="管理员取得所有权" W\-`}{B_/
"NoWorkingDirectory"="" .h4NG4FIF
3{.]!
[HKEY_CLASSES_ROOTexefileshellrunas2command] Z^Um\f
@="cmd.exe /c takeown /f "%1" && icacls "%1" /grant administrators:F" 5s\;7>
"IsolatedCommand"="cmd.exe /c takeown /f "%1" && icacls "%1" /grant administrators:F" rRe^7xGe7
X2I_,k'fQ
[HKEY_CLASSES_ROOTDirectoryshellrunas] G0m$bi=z
@="管理员取得所有权" CT_tJ
"NoWorkingDirectory"="" =}tomN(F~[
/JRZ?/<1
[HKEY_CLASSES_ROOTDirectoryshellrunascommand] =c 9nC;C
@="cmd.exe /c takeown /f "%1" /r /d y && icacls "%1" /grant administrators:F /t" 3=U#v<
"IsolatedCommand"="cmd.exe /c takeown /f "%1" /r /d y && icacls "%1" /grant administrators:F /t" 59$PWfi-\
W%5))R$