Skip to content

Instantly share code, notes, and snippets.

@jrusbatch
Created April 14, 2015 20:35
Show Gist options
  • Save jrusbatch/a6d2e18b75499098856e to your computer and use it in GitHub Desktop.
Save jrusbatch/a6d2e18b75499098856e to your computer and use it in GitHub Desktop.
@echo Off
:: If an existing file is specified, open that file. Otherwise, search the
:: current directory for a solution file to open. If a solution file is not
:: found, don't do anything.
@set VS_LAUNCHER="%PROGRAMFILES(X86)%\Common Files\Microsoft Shared\MSEnv\VSLauncher.exe"
@set TARGET="%1"
@if not exist %TARGET% (
@for %%f in (*.sln) do (
@set TARGET=%%f
@goto :LaunchVisualStudio
)
@goto :eof
)
:LaunchVisualStudio
@if exist %TARGET% @start %VS_LAUNCHER% %TARGET%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment