Takes whatever is in your clipboard, tries to figure out whether its a Linux or Windows style path, then tries to figure out if the path leads somewhere within the WSL environment or not and finally converts from the current path style (Windows path to Linux style and vise versa) to the other - and then puts the result in your clipboard.
- Set the contents of
wslRootDir.txt
to where your WSL is mounted: - Go into your WSL environtment and copy any file path:
So you have something like:
/mnt/c/Program Files/Google/Chrome/
in your clipboard. - Run
clipbordConvertBetweenWindowsAndWslFilePath.exe
(orpython clipbordConvertBetweenWindowsAndWslFilePath.py
). - You should now have the Windows equalent path in your clipboard instead, eg:
c:/Program Files/Google/Chrome
- ???
- Profit
I recommend creating a shortcut for the script and placing it in C:\ProgramData\Microsoft\Windows\Start Menu\Programs
. That way you can just press the Windows key, type "clipboard Convert" and press enter every time you want to make a conversion.
C:/Program Files/Google/Chrome
becomes/mnt/c/Program Files/Google/Chrome
/mnt/c/Program Files/Google/Chrome
becomesc:/Program Files/Google/Chrome
/home/olliver/Desktop/
becomes\\wsl.localhost\Enterprise/home/olliver/Desktop
\\wsl.localhost\Enterprise/home/olliver/Desktop
becomes/home/olliver/Desktop