# 右鍵快速開啟檔案 with Vscode, cmd In Windows 10
###### tags: `nonetype`
Copyright 2021, [月下麒麟 YMont](https://hackmd.io/@YMont/note-catalog)
---
## Outline
如下圖,就是我們最終的需求
==對著某資料夾點擊右鍵,就可以對它**使用 cmd 開啟視窗** 或是 **使用 vscode 開啟視窗**==
這樣就會很方便地且準確地對著檔案開啟對應的應用程式了!

---
## Implement
**step1**
` windows key + R` (  +  )
**step2**
`regedit`

**step3**
click `HKEY_CLASSES_ROOT\Folder\shell`

(圖1)

(圖2)
**step4**
對著shell click 右鍵新增機碼

並建立檔案名稱 `使用 cmd 開啟視窗`

接著再對著"使用 cmd 開啟視窗"再新增一層機碼 `command`

**step5**
"使用 cmd 開啟視窗"要新增**兩個字串值**
一個是`預設值`:`(可空白)`,另一個是`Icon`: `C:\Windows\System32\cmd.exe`



**step6**
* 而 "使用 cmd 開啟視窗"的"command"僅需要新增**一個字串值**

* 為`預設值`:`"C:\Windows\System32\cmd.exe" /k "cd %L"`

**step7**
**Vscode**的部分,會快速帶過,做法跟前面cmd一樣,差異僅有值不同
* "使用 vscode 開啟視窗"

* "使用 vscode 開啟視窗"的"command"

* "使用 vscode 開啟視窗"的**數值**
`Icon`:`C:\Users\oxyge\AppData\Local\Programs\Microsoft VS Code\Code.exe`

* "使用 vscode 開啟視窗"的"command"的**數值**
`預設值`:`"C:\Users\oxyge\AppData\Local\Programs\Microsoft VS Code\Code.exe" "%V"`

---
怕大家還是看不懂,用目錄架構圖來輔助說明~
```python=
#|--HKEY_CLASSES_ROOT
# |--Folder
# |--shell
# |--使用 cmd 開啟視窗(有兩個機碼)
# | |--command(有一個機碼)
# |
# |--使用 vscode 開啟視窗(有兩個機碼)
# |--command(有一個機碼)
#
```