To add a right-click context menu option in Windows Explorer that opens the current folder in Command Prompt and automatically runs code .
(to open it in VS Code), you can do this by editing the Windows Registry.
🚀 What This Will Do
When you right-click on a folder (or inside a folder and right-click empty space), you'll see an option like "Open with VS Code (code .)", which:
-
Opens a Command Prompt in that folder.
-
Runs
code .
automatically.
🛠️ Steps to Add the Context Menu Option
âś… Step 1: Open Registry Editor
Press Win + R
, type regedit
, and press Enter.
âś… Step 2: Navigate to the Context Menu Key
Go to:
Tip: This location adds the context menu item when you right-click inside a folder (not on a folder).
Tip: This location adds the context menu item when you right-click inside a folder (not on a folder).
âś… Step 3: Create a New Key
-
Right-click on shell
→ New → Key → name it:
-
Select this new key and in the right pane, double-click on (Default) and set the value to:
Right-click on shell
→ New → Key → name it:
Select this new key and in the right pane, double-click on (Default) and set the value to:
âś… Step 4: Add the Command
-
Right-click on the Open VSCode Here
key → New → Key → name it:
-
Select the command
key, and in the right pane, se
t the (Default) value to:
Right-click on the Open VSCode Here
key → New → Key → name it:
Select the command
key, and in the right pane, se
t the (Default) value to:
đź§Ş Test It
-
Right-click inside any folder in Windows Explorer.
-
You should see: "Open with VS Code (code .)"
-
Clicking it opens Command Prompt and runs code .
âś…
Right-click inside any folder in Windows Explorer.
You should see: "Open with VS Code (code .)"
Clicking it opens Command Prompt and runs code .
âś…