Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> Windows 綜合教學 >> 關於 Windows

Win7 記事本建立 .reg 刪除登錄檔鍵值:路徑前加減號一鍵移除

編輯:關於 Windows

修改登錄檔除用 regedit 手動操作外,可寫 .reg 檔匯入。刪除鍵值/子鍵值技巧:在機碼路徑或值名前加 - 號。

語法規則

  • 刪除整個機碼(含所有子機碼/值):[-HKEY_CURRENT_USER\Software\MyKey]
  • 刪除特定值:[HKEY_CURRENT_USER\Software\MyKey]
    "ValueName"=-

範例

; 刪除整個 Vista123 機碼
Windows Registry Editor Version 5.00
[-HKEY_CURRENT_USER\Software\Vista123]
"Vista123"=dword:00000001

; 僅刪除 Vista123 機碼下的 Vista123 值
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Vista123]
"Vista123"=-

操作流程

  1. 記事本貼上上述內容 → 存為 delete_key.reg。
  2. 雙擊匯入 → 是 → 確定。
  3. 用 regedit 驗證機碼/值已移除。

優勢

  • 可批次、腳本化部署,適合系統管理員自動化維護。
  • 避免手動展開機碼樹誤刪風險。
Copyright © Windows教程網 All Rights Reserved