I have a windows batch script that uses Windows Ubuntu Bash. It receives a full Windows path as an argument and then passes that path to a command in Ubuntu Bash.
@echo off
bash -lic 'ffmpeg -i "%1" output.avi'
Here "%1"
is the full Windows path, like "C:\some path\file.avi"
The command gives the error:
C:some pathfile.avi: Protocol not found
What can I do to have this Windows path convert to a path like /mnt/c/some\ path/file.avi
which the Windows Bash would actually understand?
Best Answer
Windows Build 17046 [1] contains new
wslpath
utility that can translate paths from/to WSL/Windows. This was known missing WSL feature. [2]Example usage:
You can call
wslpath
from Powershell on Windows:wslpath
options and parameters: