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

記事本一招搞定:快速刪除登錄機碼與值的 .reg 腳本寫法

編輯:Win7 系統應用技巧

修改登錄常用「匯入 .reg 檔」法,但刪除機碼/值的語法鮮為人知。其實只需在路徑或值名前加 減號 - 即可。

語法規則

目標語法範例
刪除整個機碼(含子機碼與值)在機碼路徑前加 -[-HKEY_CURRENT_USER\Software\Vista123]
刪除特定值在值名稱後指定 -[HKEY_CURRENT_USER\Software\Vista123]
"Vista123"=-

完整 .reg 檔範本

Windows Registry Editor Version 5.00

; 刪除整個 Vista123 機碼
[-HKEY_CURRENT_USER\Software\Vista123]

; 僅刪除 Vista123 這個值
[HKEY_CURRENT_USER\Software\Vista123]
"Vista123"=-
  1. 將上述內容複製至記事本。
  2. 另存為 DelReg.reg(副檔名必須為 .reg)。
  3. 雙擊匯入,確認提示即可完成刪除。

提醒: 匯入前請務必確認路徑正確,登錄操作不可逆,建議先匯出備份。

Copyright © Windows教程網 All Rights Reserved