More easily invoke Windows apps and tools from Bash on Windows


Along with support for ifconfig & network connection enumeration, Windows 10 Insider Build 14965 delivers a small but important change was made which will enable you more easily invoke Windows tools & applications from within Bash:

Your Windows user environment path is now appended to the WSL path by default. This means you can now type notepad.exe (or the name of any other app on your default Windows path) without adding the absolute path to the .exe, or to your Linux path itself!

2016-11-10-4

Also, GitHub issue #1254 has been fixed, allowing you to invoke Windows binaries from within Bash even if the current working directory contains non-ansi characters.

 

Be sure to let us know how this works for you: If you discover problems, please file an issue on our GitHub issues repo, or if you'd like to reach out, you can ping me on Twitter: https://twitter.com/richturn_ms. Look forward to hearing from you 🙂

Comments (6)

  1. Any idea why my $PATH is truncated? Because I’m running as root?

    root@Surface:~# echo $PATH
    /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/ProgramData/Oracle/Java/javapath:/mnt/c/Windows/System32:/mnt/c/Windows:/mnt/c/Windows/System32/wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0:/mnt/c/Program Files (x86)/Skype/Phone:/mnt/c/Users/biser/AppData/Local/Microsoft/WindowsApps:/mnt/c/Program Files (x86)/Microsoft VS Code/bi

    1. Good Q. Could you try again on last week’s build and if it’s still truncated, file an issue on our GitHub: https://github.com/microsoft/bashonwindows/issues.

      Thanks.

  2. Mehdi HosseinZade says:

    hi
    can we use wsl (bash) path in windows path?
    for example install oracel-java in wsl and use in android stadio (windows)?

    1. No – The Linux filesystem isn’t exposed to Windows as a drive that it can navigate around. Instead, call `bash.exe -c “”` from Windows to invoke a Bash command/script within Bash/WSL.

  3. mark says:

    Hello Rich,

    Is this PATH information stored somewhere or accessible?

    Reason I am asking is because I often tend to use my own PATH and so it would be nice to just grab the content of the above, and merge it with my own custom PATH. I assume that it is stored somewhere, either in a file, or perhaps it can be output via some tool (then I could redirect it into some file like windows_default_path.rc or something like that).

    Thanks!

    1. The Windows path entries are converted & appended to the Linux path dynamically each time a new Linux session is launched.

      You might want to take a look at modifying your path in your .bashrc. This way, you’ll be able to add/remove/re-order path entries (inc. the Windows path entries) as you see fit.

Skip to main content