Last active
November 21, 2023 17:29
-
-
Save AMZN-alexpete/37906376cee0e1b38eb42784024799ac to your computer and use it in GitHub Desktop.
Open O3DE visual studio solution from command line
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
setlocal enabledelayedexpansion | |
REM open first .sln file in build/windows_vs2022 with VS 2022 | |
for %%A in (build/windows_vs2022/*.sln) do ( | |
powershell -Command "Start-Process -FilePath 'C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\devenv.exe' -ArgumentList '%CD%\build\windows_vs2022\%%A'" | |
GOTO finished | |
) | |
REM fall back to first .sln file in build/windows_vs2019 with VS 2019 | |
for %%A in (build/windows_vs2019/*.sln) do ( | |
powershell -Command "Start-Process -FilePath 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\devenv.exe' -ArgumentList '%CD%\build\windows_vs2019\%%A'" | |
GOTO finished | |
) | |
REM open first .sln file in build folder with any Visual Studio version | |
for %%A in (build/*.sln) do ( | |
start "Visual Studio" "build/%%A" | |
GOTO finished | |
) | |
REM open first .sln file in Solutions folder with any Visual Studio version | |
for %%A in (Solutions/*.sln) do ( | |
start "Visual Studio" "Solutions/%%A" | |
GOTO finished | |
) | |
echo "no Visual Studio 2019/2022 solution found to open" | |
:finished | |
endlocal |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment