How to open Visual Studio Solution File from the Command Prompt

Eric D. Johnson picture Eric D. Johnson · Jun 20, 2017 · Viewed 16.4k times · Source

Today I was in the Windows Command Prompt after doing a git clone https://...MySolution.git and wanted to open the .sln (i.e., solution file) from the new directory of the cloned repo.

What is the command to open this new solution in Visual Studio? Suppose the relative path is /MySolution/MySolution.sln

Answer

Eric D. Johnson picture Eric D. Johnson · Jun 20, 2017

If you haven't done cd MySolution but are still in the directory from which you did the git clone just type

start MySolution/MySolution.sln and hit Enter.

This will open whatever version of Visual Studio you currently have set to open with .sln files in Windows.