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

Win7 取得檔案/資料夾完整控制權限:右鍵選單加入「管理員取得所有權」註冊表一鍵部署

編輯:Win7 常見問題解答

Win7 權限機制嚴格,存取系統檔案/其他使用者資料夾常提示「拒絕存取」。將「管理員取得所有權」加入右鍵選單,一鍵執行 takeown + icacls 遞歸取得完整控制權,無需手動輸入指令。

部署方式:匯入註冊表檔

  1. 建立文字文件,貼入下方完整內容,另存為 TakeOwnership.reg。
  2. 雙擊匯入 → 「是」確認。
  3. 右鍵任意檔案/資料夾 → 選擇「管理員取得所有權」→ CMD 閃動完成 → 即可存取/修改/刪除。

註冊表完整內容

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 /f \"%1\":取得檔案/資料夾擁有權。
  • /r /d y:資料夾遞歸處理所有子項目,自動回答「是」覆蓋。
  • icacls \"%1\" /grant administrators:F:授予 Administrators 群組完整控制權 (F)。
  • /t:遞歸套用至所有子檔案/資料夾。

適用範圍

  • 檔案 (*) 右鍵選單。
  • 執行檔 (exefile) 右鍵選單(獨立項目避免衝突)。
  • 資料夾 右鍵選單(含遞歸參數)。

⚠️ 使用警示

  • 僅對確認安全的檔案/資料夾使用(如舊備份、其他使用者遺留資料、系統舊版本檔案)。
  • 修改系統核心檔案權限可能導致系統不穩定、安全性降低、更新失敗。
  • 操作完成後建議移除權限或重置權限(icacls \"%1\" /reset /t)。

一鍵部署右鍵「取得所有權」,解決 Win7 權限拒絕存取難題,系統管理員、進階使用者必備神器。

Copyright © Windows教程網 All Rights Reserved