I am working with WSL and I have configured a context menu shortcut in File Explorer to launch a WSL bash terminal in the current directory. When no bash terminal is already running it works as expected. However when one window of the terminal is already running, launching a new window from another folder won't start the script in the new folder, but start the script in the same folder as where the previous instance was launched. I couldn't find a way to specify the current directory for starting the script, so the single window case simply works by default. I think I just need help figuring out the right options that would allow it to work for multiple windows.
Here is my context menu command (which I added to the registry in HKEY_CLASSES_ROOT\Directory\Background\shell)
C:\Windows\System32\wscript.exe C:\path\to\terminal.vbs
And here is the content of terminal.vbs
args = "-c" & " -l " & """DISPLAY=:0 terminator"""
WScript.CreateObject("Shell.Application").ShellExecute "bash", args, "", "open", 0
I think I just need to specify an option for ShellExecute that will launch it in the working directory, right now it seems like the single window case just works by default.
BACKGROUND: I followed this guide to set up the terminal in WSL. https://blog.ropnop.com/configuring-a-pretty-and-usable-terminal-emulator-for-wsl/
Note: This is my first stackexchange post and I am not too familiar with the windows command line ecosystem. I'll take suggestions on how to make the title of the post more relevant. Thank you.