Right-click on folders and open them with VS Code

I noted that one of my colleagues was opening projects by right-clicking on folders. I became jealous of that 30-second productivity boost he was enjoying in his day. He told me I could reinstall the program with this optional feature. At first, I was scared I would lose all my config(it did not happen) so I went and found this additional method on StackOverflow (https://stackoverflow.com/questions/37306672/visual-studio-code-open-with-code-does-not-appear-after-right-clicking-a-folde). I have to admit it lo looked a little scary, but the execution is very simple.

Reinstallation

Let’s first look at what to do if you choose to reinstall it.

1. Please take notes of the extensions you are using as you will lose all your configurations.

2. Find the icon, right-click, deinstall.

3. Download the latest version from here: https://code.visualstudio.com/

4. Reinstall as you normally do, but make sure to check those two boxes below.

Make sure to check those boxes!

Create a .reg file

The second method is a bit faster.

1. Create a file .txt file and copy the text below:

Version 5.00; Open files[HKEY_CLASSES_ROOT\*\shell\Open with VS Code]@=”Edit with VS Code”“Icon”=”C:\\Program Files\\Microsoft VS Code\\Code.exe,0"[HKEY_CLASSES_ROOT\*\shell\Open with VS Code\command]@=”\”C:\\Program Files\\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\\Microsoft VS Code\\Code.exe\”,0"[HKEY_CLASSES_ROOT\Directory\shell\vscode\command]@=”\”C:\\Program Files\\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\\Microsoft VS Code\\Code.exe\”,0"[HKEY_CLASSES_ROOT\Directory\Background\shell\vscode\command]@=”\”C:\\Program Files\\Microsoft VS Code\\Code.exe\” \”%V\””

2. Save the file and change the extension to .reg

3. Double click on the file. You will be prompted to allow this app to make changes to your PC. Click OK.

Right-click on folders and open them with VS Code

That’s it! We can now navigate to any folder through Windows Explorer, right-click on the icon, and see an option to “Open with Code”.

Both methods took roughly the same time took under 5 minutes to implement, so really chose that makes you comfortable.

Key takeaway? I can now look at my colleague in the eyes and enjoy my 30 extra seconds every day, knowing I took 30 minutes to try different ways to do the job and write this article in about an hour. Considering the 90 minutes, I might have gained this time back in six months or so.

Was it worth it? Totally.

--

--

Mic B. || Angular Lead Programmer

Web programmer for two years now. I learned on my own and started out by freelancing before finding my first programming position at APRIL Canada.