Skip to content

Latest commit

 

History

History
91 lines (78 loc) · 3.06 KB

README.md

File metadata and controls

91 lines (78 loc) · 3.06 KB

open-with-VSCode

Add option to open folder/file with VS Code [Win]

  1. Get VSCode path.

    • Search for Visual Studio Code in the windows search box.
      step1

    • Right click on it, then click on Open file location.
      step2

    • It should open a window like this
      step3

    • Right click on Visual Studio Code, then click on Properties.
      step4

    • Now copy all the text inside the Target: field, this will be our path.
      step5

  2. Create a .txt file.

  3. Edit .txt file content.

    • First, copy and paste the code below in the .txt file

      Windows Registry Editor Version 5.00
      
      [HKEY_CLASSES_ROOT\*\shell\Open with VS Code]
      @="Edit with VS Code"
      "Icon"="\path, 0"
      
      [HKEY_CLASSES_ROOT\*\shell\Open with VS Code\command]
      @="\path \"%1\""
      
      [HKEY_CLASSES_ROOT\Directory\shell\vscode]
      @="Open folder with VS Code"
      "Icon"="\path, 0"
      
      [HKEY_CLASSES_ROOT\Directory\shell\vscode\command]
      @="\path \"%1\""
      
      [HKEY_CLASSES_ROOT\Directory\Background\shell\vscode]
      @="Open folder with VS Code"
      "Icon"="\path, 0"
          
      [HKEY_CLASSES_ROOT\Directory\Background\shell\vscode\command]
      @="\path \"%V\""
    • Now replace path with the text you got from target propertie.

      My version looks like this:

      Windows Registry Editor Version 5.00
      
      [HKEY_CLASSES_ROOT\*\shell\Open with VS Code]
      @="Edit with VS Code"
      "Icon"="\"C:\Users\User\AppData\Local\Programs\Microsoft VS Code\Code.exe", 0"
      
      [HKEY_CLASSES_ROOT\*\shell\Open with VS Code\command]
      @="\"C:\Users\User\AppData\Local\Programs\Microsoft VS Code\Code.exe" \"%1\""
      
      [HKEY_CLASSES_ROOT\Directory\shell\vscode]
      @="Open folder with VS Code"
      "Icon"="\"C:\Users\User\AppData\Local\Programs\Microsoft VS Code\Code.exe", 0"
      
      [HKEY_CLASSES_ROOT\Directory\shell\vscode\command]
      @="\"C:\Users\User\AppData\Local\Programs\Microsoft VS Code\Code.exe" \"%1\""
      
      [HKEY_CLASSES_ROOT\Directory\Background\shell\vscode]
      @="Open folder with VS Code"
      "Icon"="\"C:\Users\User\AppData\Local\Programs\Microsoft VS Code\Code.exe", 0"
      
      [HKEY_CLASSES_ROOT\Directory\Background\shell\vscode\command]
      @="\"C:\Users\User\AppData\Local\Programs\Microsoft VS Code\Code.exe" \"%V\""
  4. Save file as .reg.

  5. Execute .reg file.

    • It should pop up 2 warnings.
      warning1

      Press 'Yes'


      warning2

      Press 'OK'