已知登錄檔路徑時,可透過記事本撰寫 .reg 檔快速刪除鍵值或子鍵值,無需手動開啟 regedit 逐層展開。
在鍵值路徑前加上 - 號。例如要刪除 HKEY_CURRENT_USER\Software\Vista123:
Windows Registry Editor Version 5.00 [-HKEY_CURRENT_USER\Software\Vista123] "Vista123"=dword:00000001
將上述內容存為 DeleteKey.reg,雙擊匯入即可。
保留父鍵值,僅刪除其下的某個值名稱。在值名稱前加 -:
Windows Registry Editor Version 5.00 [HKEY_CURRENT_USER\Software\Vista123] "Vista123"=-
同樣存為 .reg 檔匯入即可移除該值。
適用範圍: Windows Vista、Windows 7、Windows 8/8.1、Windows 10/11 均支援。善用 .reg 檔可將登錄檔修改腳本化、文件化,便於部署與備份。