🔧

How to Restore 'Open with Code' in VSCode Right-Click Menu

5 min read

Learn how to restore the missing 'Open with Code' option in Windows right-click context menu with two effective methods: VSCode reinstallation and manual registry file configuration.

When developing, right-clicking files or folders to open them in VSCode is a daily routine. However, sometimes the "Open with Code" menu option mysteriously disappears.

This article provides two proven solutions to restore this essential functionality. We'll start with the simplest reinstallation method, then cover manual registry configuration for stubborn cases.

Prerequisites

This guide targets Windows environments. Registry file configuration is Windows-specific, so macOS and Linux users will need alternative approaches.

Identifying the Problem

First, let's confirm that the "Open with Code" menu is actually missing.

Normally, when you right-click files or folders, you should see:

  • For folders: "Open with Code"
  • For files: "Open with Code"

If these menu options are missing, the following methods will restore them.

Solution 1: VSCode Reinstallation

The simplest and most reliable approach is reinstalling VSCode.

Steps

  1. Visit VSCode Official Website

    Navigate to the Visual Studio Code official website.

  2. Download the Installer

    Click the "Download for Windows" button to download the installer.

  3. Run the Installation

    Execute the downloaded installer and follow the installation wizard.

    Important Notes:

    • No need to uninstall existing VSCode
    • If you see "Add to right-click menu" option during installation, ensure it's checked
  4. Verify Functionality

    After installation completes, right-click any file or folder to confirm the "Open with Code" menu appears.

This method resolves most cases, but if the menu still doesn't appear, try the manual configuration below.

Solution 2: Manual Registry File Configuration

When reinstallation doesn't work, we can directly edit Windows registry to add the right-click menu.

Step 1: Locate VSCode Executable Path

First, we need to find where VSCode's executable file (Code.exe) is located.

  1. Launch VSCode

    Start VSCode application.

  2. Open Task Manager

    Press Ctrl + Shift + Esc to open Task Manager.

  3. Find Code.exe Path

    • Locate "Code.exe" in the process list
    • Right-click and select "Open file location"
    • When Explorer opens, copy the full path from the address bar

    Example: C:\Users\username\AppData\Local\Programs\Microsoft VS Code\Code.exe

Step 2: Create Registry File

Next, we'll create a registry configuration file.

  1. Open Notepad

    Open Windows Notepad.

  2. Paste the Following Content

    registry
    Windows Registry Editor Version 5.00
    
    ; --- "Open with Code" menu for folder right-click ---
    ; Register right-click settings for folders
    [HKEY_CLASSES_ROOT\Directory\shell\VSCode]
    @="Open with Code"
    "Icon"="\"C:\\Users\\username\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe\",0"
    
    [HKEY_CLASSES_ROOT\Directory\shell\VSCode\command]
    @="\"C:\\Users\\username\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe\" \"%V\""
    
    ; --- "Open with Code" menu for file right-click ---
    ; Register right-click settings for files
    [HKEY_CLASSES_ROOT\*\shell\VSCode]
    @="Open with Code"
    "Icon"="\"C:\\Users\\username\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe\",0"
    
    [HKEY_CLASSES_ROOT\*\shell\VSCode\command]
    @="\"C:\\Users\\username\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe\" \"%1\""
    
  3. Replace the Path

    Replace username with your actual Windows username.

    Example: If the path from Step 1 is C:\Users\john\AppData\Local\Programs\Microsoft VS Code\Code.exe, set it as:

    C:\\Users\\john\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe
    
  4. Save the File

    Save the file with a .reg extension, such as "vscode-menu.reg".

Step 3: Apply Registry Settings

  1. Execute the Registry File

    Double-click the created .reg file.

  2. Confirm in Dialog

    When prompted "Do you want to add the information to the registry?", click "Yes".

  3. Verify Completion

    When you see "Information has been successfully entered into the registry", click "OK".

Step 4: Restart Explorer

To apply the registry changes, restart Windows Explorer.

  1. Open Task Manager (Ctrl + Shift + Esc)
  2. Select "Windows Explorer"
  3. Click the "Restart" button

Step 5: Verify Functionality

After Explorer restarts, verify:

  • Right-click any folder → "Open with Code" appears
  • Right-click any file → "Open with Code" appears

Removing the Configuration

If you made a mistake or want to remove the right-click menu, use the following removal registry file.

Creating Removal Registry File

  1. Open Notepad

    Open a new Notepad window.

  2. Paste the Following Content

    registry
    Windows Registry Editor Version 5.00
    
    ; --- Remove "Open with Code" menu for folders ---
    [-HKEY_CLASSES_ROOT\Directory\shell\VSCode]
    
    ; --- Remove "Open with Code" menu for files ---
    [-HKEY_CLASSES_ROOT\*\shell\VSCode]
    
  3. Save the File

    Save with a .reg extension, such as "vscode-menu-remove.reg".

  4. Execute Removal

    Double-click the removal .reg file and confirm with "Yes" in the dialog.

  5. Restart Explorer

    Restart Explorer using the method described earlier to remove the "Open with Code" menu.

Troubleshooting

  • Verify the path is correctly configured
  • Ensure username is properly replaced
  • Confirm VSCode is correctly installed

Permission Errors

  • Try running the registry file as administrator
  • Check if antivirus software is blocking the operation

Configuration Mistakes

  • Use the removal registry file to reset settings
  • Then re-add with correct configuration

Summary

We've covered two methods to restore VSCode's missing right-click menu:

Solution 1: Reinstallation

  • Simplest and most reliable
  • Preserves existing settings
  • Resolves most cases

Solution 2: Manual Configuration

  • Effective when reinstallation fails
  • Direct registry editing for guaranteed results
  • Requires more steps but provides fundamental solution

This small feature significantly impacts development efficiency. When it disappears, it's genuinely inconvenient. I hope this article helps anyone facing the same issue.

Note: This article is based on information as of January 2025. Configuration methods may change due to VSCode version updates.

Related Articles