Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學

Windows 7 取得檔案/資料夾完整控制權:匯入登錄檔或用優化工具加入右鍵選單

編輯:Win7 系統應用技巧

Windows 7 為保護系統檔案,預設連管理員也無法直接修改部分系統檔案,必須先取得「擁有者」權限再給予完整控制權。每次手動設定極繁瑣。本文提供兩種一鍵解決方案:匯入登錄檔加入右鍵「管理員取得所有權」、或使用優化工具內建功能。

方法一:匯入登錄檔,右鍵選單直接取得權限

將以下內容存為 TakeOwnership.reg,雙擊匯入登錄檔:

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"

登錄檔內容示意

匯入後,對任何檔案/資料夾右鍵即見「管理員取得所有權」,點選即自動執行 takeown 與 icacls 完成權限遷移。

方法二:使用 Windows 7 優化大師等工具

如「Windows 7 優化大師」、「Windows 7 總管」等工具,其「系統設定」→「右鍵選單設定」中通常內建「取得管理員權限」選項,勾選即可生效,免去手動編輯登錄檔。

優化大師右鍵設定介面

權限機制雖保護系統安全,但也阻礙合法管理操作。善用上述工具,讓取得權限變成右鍵一鍵完成。

Copyright © Windows教程網 All Rights Reserved