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 . ✅