Skip to content

Instantly share code, notes, and snippets.

@AMZN-alexpete
Last active November 21, 2023 17:29
Show Gist options
  • Save AMZN-alexpete/37906376cee0e1b38eb42784024799ac to your computer and use it in GitHub Desktop.
Save AMZN-alexpete/37906376cee0e1b38eb42784024799ac to your computer and use it in GitHub Desktop.
Open O3DE visual studio solution from command line
@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