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

登錄編輯器每次啟動停留在根鍵:LastKey 鍵值權限鎖定法(進階版)

編輯:Windows XP 系統介紹

Windows XP 登錄編輯器預設記住上次位置。若習慣從根鍵開始瀏覽,可清除 LastKey 並鎖定權限,強制每次啟動皆在根鍵。本文提供完整操作與原理說明。

操作步驟

  1. regedit → HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit。
  2. 刪除右側 LastKey 字串值。
  3. 右鍵 Regedit 主鍵 → 「權限」→ 選擇目前帳號 → 所有權限設為「拒絕」。
  4. 確定,關閉登錄編輯器。

運作原理

  • 啟動時讀取 LastKey 決定定位分支。
  • 刪除後找不到目標,預設根鍵。
  • 權限「拒絕」防止系統重寫 LastKey,維持根鍵啟動狀態。

恢復正常行為

以另一管理員帳號登入,或使用 regini、subinacl、SetACL 等工具重置 Regedit 鍵值權限為「允許」。

替代方案:登入腳本自動重置(不影響編輯權限)

  1. 建立 ResetLastKey.reg:
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit]
"LastKey"=-
  1. 「群組原則編輯器」gpedit.msc → 使用者設定 → Windows 設定 → 指令碼(登入/登出) → 登入 → 新增 → 指令碼名稱:regedit.exe /s "路徑\ResetLastKey.reg"。
  2. 下次登入自動重置,日常編輯權限不受影響。

適用版本

Windows XP / Server 2003 / Vista / 7 / 8 / 10 / 11 路徑相同,權限鎖定邏輯通用。

Copyright © Windows教程網 All Rights Reserved