Context Menu entries to open WSL shell

If you run wt.exe -d "C:\Program Files" from a Command Prompt, does it open in the specified Program Files folder?

It is still opened $HOME directory. If I pass Linux path as following,

wt.exe -d /mnt/c/QA (This is my c:\QA folder under Windows)

Windows terminal just crashes with following error.

[error 0x8007010b when launching `wsl.exe -d Ubuntu']

But if I changed the default profile to "cmd" in Windows terminal, then it opened in the correct directory.

Seems like a wt.exe issue at this point, or maybe not the right syntax (but I don't know wt.exe to tell you the correct syntax if that's the case).

This works for me.

I guess your default profile is "cmd" or "Windows PowerShell". If you installed Ubuntu or other Linux distro, and set it as default profile, will this still work for you?

I set the default to Ubuntu, and yes it still works (running wt.exe -d "C:\Program Files" from Start -> Run opens WT with the CD set to /mnt/c/Program Files).

I tried the same command you did on two machines. One installed wsl and the other one installed wsl2. They all opened Ubuntu and the CD set to HOME. Strange!