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

Win7 右鍵選單加入「安全移除 USB」:登錄表自訂右鍵指令

編輯:Win7 系統基礎知識

每次拔 USB 都要找右下角圖示太麻煩?修改登錄表在桌面/資料夾右鍵選單直接加入「移除 USB」指令,一鍵呼叫系統安全移除介面。

登錄表建立步驟

  1. Win+R → regedit。
  2. 瀏覽至:
    HKEY_CLASSES_ROOT\DesktopBackground\Shell
  3. 右鍵 Shell →「新增」→「機碼」→ 命名 Remove USB。
  4. 在 Remove USB 下:
     - 新增「字串值」命名 Icon,數值資料:hotplug.dll,-100(顯示 USB 圖示)。
     - 新增「機碼」命名 command。
     - 在 command 下雙擊「(預設)」→ 數值資料:
    C:\Windows\System32\control.exe hotplug.dll
  5. 完成,**無需重開機**,桌面右鍵即見「Remove USB」選項。

開啟 regedit
定位 DesktopBackground Shell
新增 Remove USB 機碼
新增 Icon 字串值
設定 Icon 數值
新增 command 子機碼
設定 command 數值
右鍵選單出現 Remove USB

效果

  • 點選後彈出「安全移除硬體」對話框,可選裝置停用後再拔出。
  • 適用所有 USB 大量儲存裝置(隨身碟、外接硬碟、讀卡機等)。

原理

control.exe hotplug.dll 是系統內建「安全移除硬體」精靈的呼叫指令。登錄表 DesktopBackground\Shell 定義桌面/資料夾背景右鍵擴充功能,類似「Open with Code」、「Git Bash Here」等第三方右鍵選單原理。

右鍵即達,USB 安全移除零距離!

Copyright © Windows教程網 All Rights Reserved