win7中有可能誤操作導致某些文件目錄需要獲得管理員權限才能刪除或者是更改,因此需要獲得管理員權限。但是剛裝的系統中,右鍵中是沒有“獲取管理員權限”的菜單項的,因此需要手動添加:
通過新建一個“獲取管理員權限.reg”的文件,用編輯器打開後復制進去下面的內容,保存雙擊添加到注冊表中即可:
Xml代碼
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT*shellrunas]
@="獲取管理員權限"
"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]
@="獲取管理員權限"
"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]
@="獲取管理員權限"
"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"