This is a simple program that allows you to open a folder in VSCode under WSL remote connect via a simple command line call.
- Download the latest release from the releases page / Directly clone the repository / Directly compile
- Add the executable to your path
Compilation:
g++ -o codeWSL.exe codeWSL.cpp
The program can be run via right click menu in Windows Explorer or via command line.
codeWSL.exe [-d Distribution] <Path>
- Open the registry editor
- Goto
Computer\HKEY_CLASSES_ROOT\Directory\Background\shell
- Add a new key with the name of your choice,
<Your Key>
- Goto
Computer\HKEY_CLASSES_ROOT\Directory\Background\shell\<Your Key>
- Create a new
String value
under the key you just created calledIcon
, set the value to the path of the icon you want to use. - Create a new
String value
under the key you just created called(Default)
, set the value to the name you want to appear in the right click menu. - Create a new key under the key you just created called
command
- Goto
Computer\HKEY_CLASSES_ROOT\Directory\Background\shell\<Your Key>\command
- Create a new
String value
under the key you just created called(Default)
, set the value to the path of the executable followed by"%V"
.
Example of the final registry path:
Computer\HKEY_CLASSES_ROOT\Directory\Background\shell\CodeWSL\command
Example of the value for (Default):
:: Run with the default distribution
"C:\Custom Program\codeInWSL\codeWSL.exe" "%V"
:: Run with a specific distribution
"C:\Custom Program\codeInWSL\codeWSL.exe" -d Ubuntu-20.04 "%V"