How to add an Open WSL here context menu in Windows 11#
In this blog post I will explain how I added an ‘Open WSL here’ context menu in Windows 11.

TL;DR Solution:#
Find your wt.exe path
(Get-Command wt.exe).Source
For me it returned something like:
C:\Users\ray\AppData\Local\Microsoft\WindowsApps\wt.exe
Create the per-user registry key
Open Regedit.
Go to (or create) these keys under your user hive (HKEY_CURRENT_USER):
HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\WSL
Under
WSL
, make a command sub-key.Select command, double-click (Default), and set it to:
"C:\Users\ray\AppData\Local\Microsoft\WindowsApps\wt.exe" -p "Ubuntu 24.04.1 LTS" -d "%V"
Close Regedit, then restart Explorer or log out and back in.
(Optional) Add an icon
Navigate to the same key we in we used in step 2.2:
HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\WSL
Right-click the right panel -> New -> String Value
Name it “Icon”
Right-click on “Icon” and select “Modify”
Enter the path to your desired
.ico
. E.g. I made a directory atC:\Users\<USERNAME>\WindowsTerminalIcons
containing a file calledubuntu.ico
which I generated by finding a .png of the Ubuntu logo and then finding a png to ico converter online. So I enteredC:\Users\<USERNAME>\WindowsTerminalIcons\ubuntu.ico
.
Things I tried / common pitfalls#
Environment details#
To give some context: I’m on Windows 11, and I installed Windows Terminal from the Microsoft Store. That means wt.exe
is really just an alias in:
C:\Users\<you>\AppData\Local\Microsoft\WindowsApps\wt.exe
If I had installed Windows Terminal by downloading the executable installer the traditional way from the Microsoft website, I’d have a real binary at C:\Program Files\Windows Terminal\wt.exe
and none of the alias drama below would have been an issue.
Tip: Before beginning, check if you can open Windows Terminal by pressing Win + R, typing wt.exe
, and hitting Enter. If it doesn’t launch, read on.
Why I worked under HKEY_CURRENT_USER instead of HKEY_CLASSES_ROOT#
I first tried editing the key I found in the screenshot under:
HKEY_CLASSES_ROOT\Directory\Background\shell\WSL\command
But I got an “access denied” message. By consulting ChatGPT, I learned that anything I put under:
HKEY_CURRENT_USER\Software\Classes\Directory\Background\shell\WSL
would override the global settings in HKEY_CLASSES_ROOT
. And since that HKEY_CURRENT_USER path belongs to me, I could edit it without admin rights.
Picking the right placeholder: %V
vs %1
#
When Explorer runs my command, it replaces:
%V
→ the folder path when I right-click the background of a folder window%1
→ the path when I right-click the folder icon itself
I wanted the menu item on the empty space (background), so I used %V
to pass the directory path into my wt.exe
call.
The console host vs Windows Terminal#
My first working command was:
wsl.exe -d Ubuntu-24.04 --cd "%V"
That dropped me into Ubuntu-24.04 correctly, but in the old console host, so the tab title stayed “cmd”.
Next, I changed it to:
wt.exe -p "Ubuntu 24.04.1 LTS" -d "%V"
From PowerShell or cmd, that launched Windows Terminal with the right tab title. But when I clicked the context menu entry, nothing happened. No error, no window—just silence. This confirmed that the Store alias wt.exe
wasn’t resolving in Explorer.
Quick experiments#
cmd.exe /c start "" wt ...
worked but flashed a brief cmd window.- Direct
wt.exe
worked in shells but hung or failed in Explorer and Run. - Using the real binary path fixed everything—no flashes, no hangs.
Final fix: use the real WT binary#
I ran (Get-Command wt.exe).Source
to get the full path to the real EXE, then updated my HKEY_CURRENT_USER registry entry to:
"C:\Users\ray\AppData\Local\Microsoft\WindowsApps\wt.exe" -p "Ubuntu 24.04.1 LTS" -d "%V"
After restarting Explorer, Shift + Right-Click on any folder background and choosing Open WSL here fires up Windows Terminal directly into Ubuntu-24.04, with the proper tab title and no extra console windows.
Summary highlights:
- Check your alias: Win + R →
wt.exe
- Override global registry by editing HKEY_CURRENT_USER\Software\Classes
- Use
%V
for background clicks - Find the real
wt.exe
path with(Get-Command wt.exe).Source
- Point your context-menu command at that full path for a clean launch