How to add "Open source as VS code project" in the sub-menu

Context:

Have sprint through the installation of Visual code and forgot to include the `Add "Open with Code" action to Windows Explorer file context menu` ?

If so, I have the solution for you, without needing to reinstall VS code of course.

Step 1: Create a .reg file

Step 2: Add the content below in the file


                  Windows Registry Editor Version 5.00
                  ; 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_CURRENT_USER\Software\Classes\Directory\shell\vscode]
                  @="Open Folder as VS Code Project"

                  "Icon"="\"D:\\Visual studio code\\Microsoft VS Code\\Code.exe\",0"
                  [HKEY_CURRENT_USER\Software\Classes\Directory\shell\vscode\command]
                  @="\"D:\\Visual studio code\\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_CURRENT_USER\Software\Classes\Directory\Background\shell\vscode]
                  @="Open Folder as VS Code Project"
                  "Icon"="\"D:\\Visual studio code\\Microsoft VS Code\\Code.exe\",0"

                  [HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\vscode\command]
                  @="\"D:\\Visual studio code\\Microsoft VS Code\\Code.exe\" \"%V\""
                

Step 3: Save the file as .reg file

Step 4: Double click on the .reg file

Step 5 (Optional): Allow to run as administration