Open up WSL in Current Window (Right Click Context Menu: Registry Add)


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

  1. create a file called wsl-install-contect.reg
  2. add the code at the bottom of this list and save it (remove formatting from text when pasting):
  3. double click and give permissions

; 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]
@=”wsl.exe”

; For right-clicking on folders directly
[HKEY_CLASSES_ROOT\Directory\shell\WSLHere]
@=”Open in WSL”
“Icon”=”C:\Windows\System32\wsl.exe”

To Remove the registry entry:

  1. create a file called wsl-remove-context.reg
  2. add the code at the bottom of this list and save it
  3. double click and give permissions

Leave a Reply

Your email address will not be published. Required fields are marked *