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

Win XP 利用右鍵選單實現磁碟自動整理:撰寫 .inf 檔新增「Defrag」命令到磁碟機右鍵選單

編輯:XP 系統基礎知識

整理磁碟碎片通常要進屬性視窗點按鈕。更快捷法:自訂右鍵選單加入「Defrag」命令,右鍵磁碟機即可直接啟動整理(在 DOS 模式下執行)。

製作步驟

  1. 開啟記事本,輸入以下內容並存為 context_defrag.inf(存檔類型選「所有檔案」):
    ; context_defrag.INF
    ; Adds Defrag to the right click context menu in Windows XP
    [version]
    signature="$CHICAGO$"
    [DefaultInstall]
    AddReg=AddMe
    [AddMe]
    HKCR,"Drive\Shell\Defrag\command",,,"DEFRAG.EXE %1"
  2. 右鍵該檔 → 選「安裝」
  3. 開啟「我的電腦」,右鍵任意磁碟機 → 多出「Defrag」項,點擊即自動啟動整理

使用與移除

  • 整理過程按 Ctrl+C 可取消
  • 不想要時:regedit → HKEY_CLASSES_ROOT\Drive\shell\ → 刪除 Defrag 資料夾

簡單幾步,讓磁碟整理觸手可及,DIY 樂趣無窮。

Copyright © Windows教程網 All Rights Reserved