1. 新增notepad++到右鍵選單[1]

新增到 右鍵選單

將以下內容儲存為 OpenWithNotepad++.reg 檔案,雙擊執行即可(其中可執行檔案路徑和選單項名稱請自行替換):

注: 下面程式碼需把路徑改為自己的路徑.

改完後刪除 //改完請刪掉此註釋

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*\shell\NotePad++]
@="Edit with NotePad++"
"Icon"="C:\\Program Files\\Notepad++\\notepad++.exe" //改完請刪掉此註釋 [HKEY_CLASSES_ROOT\*\shell\NotePad++\Command]
@="\"C:\\Program Files\\Notepad++\\notepad++.exe\" \"%1\"" //改完請刪掉此註釋

從右鍵選單刪除[2]

如果要刪除右鍵選單,也是一樣的道理:

將以下內容儲存為 removeNotepad++Menu.reg 檔案

Windows Registry Editor Version 5.00

[-HKEY_CLASSES_ROOT\*\shell\NotePad++]

.reg 檔案簡要說明(registry)[3]

Windows Registry Editor Version 5.00
;說明檔案以下內容使用Windows登錄檔編輯器5.00 的版本來讀取
[HKEY_CLASSES_ROOT\*\shell\NotePad++]
;這個[]裡面的內容是登錄檔可識別的目錄,如不存在則新建
@="Edit with NotePad++"
;這個是顯示在滑鼠右鍵選單欄上的內容(實際上是一個省略名稱的鍵值對或者說變數,對應下圖中的(預設),可以在登錄檔編輯器中新建)
"Icon"="C:\\Program Files\\Notepad++\\notepad++.exe"
;這個是點選右鍵選單欄實際開啟的程式(名為"Icon"的鍵值對,可以在登錄檔編輯器中新建) [HKEY_CLASSES_ROOT\*\shell\NotePad++\Command]
@="\"C:\\Program Files\\Notepad++\\notepad++.exe\" \"%1\""
;windows 字串中的字元"\"和"""需要用"\"來轉義,"%1" 指的是滑鼠選中的內容,如左鍵選中"helloWord.py",
;右鍵選擇"Edit with Notepad++"時,"helloWord.py"將會作為引數值傳遞,"%1"指的就是"helloWord.py",
;實際上,%1應該會包含絕對路徑,比如"C:\\helloWord.py"。

reg語法參考:

   http://blog.sina.com.cn/s/blog_4b0ca6b101000718.html

bat指令碼註釋參考

  https://blog.csdn.net/wh_19910525/article/details/8125762

2. 把 VS Code 新增到右鍵選單開啟檔案和資料夾[4]

新建文字 把下面程式碼放進去 改名為 vsCodeOpenFolder.reg .

注: 下面程式碼需把路徑改為自己的路徑.

改完後刪除 //改完請刪掉此註釋

一切改完,執行此檔案即可.

Windows Registry Editor Version 5.00   

; Open files
[HKEY_CLASSES_ROOT\*\shell\Open with VS Code]
@="Edit with VS Code"
"Icon"="D:\\LENOVOE\\Microsoft VS Code\\Code.exe",0" //改完請刪掉此註釋 [HKEY_CLASSES_ROOT\*\shell\Open with VS Code\command]
@="\"D:\\LENOVOE\\Microsoft VS Code\\Code.exe\" \"%1\"" //改完請刪掉此註釋 ; This will make it appear when you right click ON a folder
; The "Icon" line can be removed if you don't want the icon to appear [HKEY_CLASSES_ROOT\Directory\shell\vscode]
@="Open Folder as VS Code Project"
"Icon"="D:\\LENOVOE\\Microsoft VS Code\\Code.exe",0" //改完請刪掉此註釋 [HKEY_CLASSES_ROOT\Directory\shell\vscode\command]
@="\"D:\\LENOVOE\\Microsoft VS Code\\Code.exe\" \"%1\"" //改完請刪掉此註釋 ; This will make it appear when you right click INSIDE a folder
; The "Icon" line can be removed if you don't want the icon to appear [HKEY_CLASSES_ROOT\Directory\Background\shell\vscode]
@="Open Folder as VS Code Project"
"Icon"="D:\\LENOVOE\\Microsoft VS Code\\Code.exe",0" //改完請刪掉此註釋 [HKEY_CLASSES_ROOT\Directory\Background\shell\vscode\command]
@="\"D:\\LENOVOE\\Microsoft VS Code\\Code.exe\" \"%1\"" //改完請刪掉此註釋

  1. 手動添加註冊表,不推薦!不過可以參考下圖片。新增notepad++到右鍵選單 - 簡書 (jianshu.com)

  2. 新增 Notepad++ 至右鍵選單的幾種方法-xiaoerbuyu1233的部落格 (archive.org)

  3. Notepad++ 新增到右鍵選單欄 快速開啟檔案 - 有你~你是美好滴 - 部落格園 (archive.org)

  4. 把 VS Code 新增到右鍵選單開啟檔案和資料夾 ( 其他程式一樣 ) - 簡書 (archive.org)