Skip to content

Instantly share code, notes, and snippets.

@djfdyuruiry
Last active January 6, 2018 17:04
Show Gist options
  • Save djfdyuruiry/092a96504eec9f0c2cf9779c6e471abe to your computer and use it in GitHub Desktop.
Save djfdyuruiry/092a96504eec9f0c2cf9779c6e471abe to your computer and use it in GitHub Desktop.
Loads Bash on Ubuntu on Windows, sets bash pwd to the Windows dir where the bat script currently is, and executes a command specified by first parameter.
C:\Windows\System32\bash.exe -c "echo '%~dp0' | sed -e 's|\\\\|/|g' -e 's|^\([A-Za-z]\)\:/\(.*\)|/mnt/\L\1\E/\2|' | cd && %1"
@djfdyuruiry
Copy link
Author

Example: exec_wsl_cmd.bat ./someBuildUtil.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment