This code assumes that you have Windows Subsystem for Linux installed in your Windows 10/11 environment
*Full Disclosure* This adds code to your Registry
- create a file called wsl-install-contect.reg
- add the code at the bottom of this list and save it (remove formatting from text when pasting):
- double click and give permissions
Windows Registry Editor Version 5.00
; Add “Open in WSL” to standard right-click context menu
[HKEY_CLASSES_ROOT\Directory\Background\shell\WSLHere]
@=”Open in WSL”
“Icon”=”C:\Windows\System32\wsl.exe”
[HKEY_CLASSES_ROOT\Directory\Background\shell\WSLHere\command]
@=”cmd.exe /k wsl.exe”
; For right-clicking on folders directly
[HKEY_CLASSES_ROOT\Directory\shell\WSLHere]
@=”Open in WSL”
“Icon”=”C:\Windows\System32\wsl.exe”
[HKEY_CLASSES_ROOT\Directory\shell\WSLHere\command]
@=”cmd.exe /k wsl.exe”
To Remove the registry entry:
- create a file called wsl-remove-context.reg
- add the code at the bottom of this list and save it
- double click and give permissions
Windows Registry Editor Version 5.00
; Remove WSL entries from right-click context menu
[-HKEY_CLASSES_ROOT\Directory\Background\shell\wsl]
[-HKEY_CLASSES_ROOT\Directory\shell\wsl]
[-HKEY_CLASSES_ROOT\Directory\Background\shell\WSLHere]
[-HKEY_CLASSES_ROOT\Directory\shell\WSLHere]
Leave a Reply