Launch Visual Studio from Bash on Windows

Since I’m starting to use Bash on Windows (WSL) more regularly, I added a quick way to launch Visual Studio 2017.

  1. Edit .bashrc and add the VS path (I’m obviously using Enterprise so your path may be different):  export PATH=$PATH:”/mnt/c/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/Common7/IDE”
  2. I chose to add an alias, so I also added this to my .bashrc:  alias vs2017=devenv.exe
  3. Reload your shell:  . /.bashrc

Now I can quickly pop open Visual Studio by using “vs2017”. For example, to open an existing solution I can navigate to the folder containing the .sln and simply type “vs2017 mysolutionfile.sln” at my bash prompt and VS2017 will fire up with that project loaded.

Here’s my .bashrc if you want to see the full file.

Leave a Reply

Your email address will not be published. Required fields are marked *