+@echo off
+
+Setlocal EnableDelayedExpansion
+
+rem Setup environment
call "%~dp0env.bat" %1 %2 %3
-if ["%CASDEB%"] == [""] (
- call "%~dp0..\..\..\msvc.bat" %VCVER% win%ARCH% "" %~dp0All-%VCVER%.sln
+rem Define path to project file
+set "PRJFILE=%~dp0All-%VCFMT%.sln"
+
+rem Launch Visual Studio - either professional (devenv) or Express, as available
+if exist "%DevEnvDir%\devenv.exe" (
+ start "" "%DevEnvDir%\devenv.exe" "%PRJFILE%"
+) else if exist "%DevEnvDir%\%VisualStudioExpressName%.exe" (
+ start "" "%DevEnvDir%\%VisualStudioExpressName%.exe" "%PRJFILE%"
) else (
- call "%~dp0..\..\..\msvc.bat" %VCVER% win%ARCH% %CASDEB% %~dp0All-%VCVER%.sln
-)
\ No newline at end of file
+ echo Error: Could not find MS Visual Studio ^(%VCFMT%^)
+ echo Check relevant environment variable ^(e.g. VS100COMNTOOLS for vc10^)
+)