Como adicionar um menu de contexto "abrir com VS Code" ao Windows Explorer?

leticiacamposs2

Leticia Campos

Posted on July 5, 2021

Como adicionar um menu de contexto "abrir com VS Code" ao Windows Explorer?

Segue tutorial:

1) Abra um novo bloco de notas (notepad) e salva o documento com o nome vsCodeOpenFolder.reg e o tipo como todos os arquivos

2

2) Cole o seguinte script dentro desse documento em branco:



Windows Registry Editor Version 5.00
; Open files

[HKEY_CLASSES_ROOT\*\shell\Open with VS Code]
@="Edit with VS Code"
"Icon"="C:\\Program Files (x86)\\Microsoft VS Code\\Code.exe,0"

[HKEY_CLASSES_ROOT\*\shell\Open with VS Code\command]
@="\"C:\\Program Files (x86)\\Microsoft VS Code\\Code.exe\" \"%1\""

; This will make it appear when you right click ON a folder
; The "Icon" line can be removed if you don't want the icon to appear

[HKEY_CLASSES_ROOT\Directory\shell\vscode]
@="Open Folder as VS Code Project"
"Icon"="\"C:\\Program Files (x86)\\Microsoft VS Code\\Code.exe\",0"

[HKEY_CLASSES_ROOT\Directory\shell\vscode\command]
@="\"C:\\Program Files (x86)\\Microsoft VS Code\\Code.exe\" \"%1\""

; This will make it appear when you right click INSIDE a folder
; The "Icon" line can be removed if you don't want the icon to appear

[HKEY_CLASSES_ROOT\Directory\Background\shell\vscode]
@="Open Folder as VS Code Project"
"Icon"="\"C:\\Program Files (x86)\\Microsoft VS Code\\Code.exe\",0"

[HKEY_CLASSES_ROOT\Directory\Background\shell\vscode\command]
@="\"C:\\Program Files (x86)\\Microsoft VS Code\\Code.exe\" \"%V\""


Enter fullscreen mode Exit fullscreen mode

3) Clique no arquivo 2 vezes e execute:

image

4) Feito isso será exibido a opção de "Open Folder as VS Code" ao seu windows explorer:

image

💖 💪 🙅 🚩
leticiacamposs2
Leticia Campos

Posted on July 5, 2021

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related