Windows Context Menu Customization

Windows Context Menu Customization

Purpose

我想要達成右鍵選單可以直接執行某個bat或script

Steps

  1. 開啟rededit
  2. 電腦\HKEY_CLASSES_ROOT\Directory\Background\shell\新增機碼,名字可以隨便取
  3. 新增名為command的機碼
  4. 新增名為Icon的字串值並設定value為ico的path
  5. (Optional)新增名為HasLUAShield的字串值,不需要設定value
  6. 點進command後設定value為要啟動的執行檔或bat檔案的path

Script

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\Background\shell\<ContextMenuName>]
@="<ContextMenuName>"
"Icon"="<path to ico>"
"HasLUAShield"=""

[HKEY_CLASSES_ROOT\Directory\Background\shell\<ContextMenuName>\command]
@="\"<path to exe/bat file with double ba>\""