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

記事本快速建立 .reg 檔:一鍵刪除登錄檔鍵值與子鍵值

編輯:Win7 系統應用技巧

已知登錄檔路徑時,可透過記事本撰寫 .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 檔可將登錄檔修改腳本化、文件化,便於部署與備份。

Copyright © Windows教程網 All Rights Reserved