Add "Open with Visual Studio Code" shortcut to right click menu
Asked Answered
P

2

15

Step 1: Open Run and Access the Registry Editor

Opening Registry Editor

Step 2: Navigate to the Following Directory in the Registry Editor

Navigate to Directory

Computer\HKEY_CLASSES_ROOT\Directory\Background\shell

Step 3: Create a New Key

Create New Key in Shell

Setting Up the Name and Icon of the Shortcut:

Values

  • (Default): "Shortcut Name" (e.g., "Open with Visual Studio Code")
  • Icon: "Shortcut Icon" (Path to the icon, e.g., "Path to Code.exe in the example")

Command:

Creating Command

Create a new key in your directory and set the "(Default)" value to the command.

  • (Default): "Path to Visual Studio Code" "."

This is not a question but rather a guide on how to add the "Open with Visual Studio Code" option to the right-click menu.

Polygraph answered 29/1, 2023 at 6:55 Comment(1)
"This is not Question" Then what is it? If you want to share knowledge, that's fine. Just do it on the right site, making sure that it's on-topic, and separating the question and answer into question and answer posts (see How to Ask and How to Answer).Silicle
C
6

For those who are new to the Registry Editor, here's an additional note for Step 3:

  1. Double-click on the (Default) key to open a popup.
  2. Enter your value there.

If you're entering "Open with Visual Studio Code," that's fine. However, if you're entering a path, remember to wrap your path in double quotes, as shown in the example above.

For instance, my icon value is:

"C:\Users\PACKARD BELL\AppData\Local\Programs\Microsoft VS Code\Code.exe"

And my command value in the command key is:

"C:\Users\PACKARD BELL\AppData\Local\Programs\Microsoft VS Code\Code.exe" .

Notice that with the command value here, we have the path wrapped in double quotes, as well as white space and a dot wrapped in double quotes.

Cressida answered 26/8, 2023 at 20:7 Comment(0)
B
0

I installed through Microsoft Dev Preview, it didn't ask for any option and install it directly.

If you facing issue with where path is visible but correct directory not opening, put the command value as

C:\Users\abhijit\AppData\Local\Programs\Microsoft VS Code\Code.exe "%V"

where %V is selected directory

enter image description here

Burglary answered 6/3, 2024 at 9:50 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.