@echo off
cls
echo    File:     zz_BuildDemo64.bat
echo.
echo    Created:  26/Jan/2018
echo    Updated:  15/Dec/2023
echo.
echo    Author:   Davide Calabro'     info@softechsoftware.it
echo                                  www.softechsoftware.it
echo.
echo.
set PREVDIR=%~dp0
if not exist "C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Auxiliary\Build\vcvars64.bat" goto programfilesx86
call "C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Auxiliary\Build\vcvars64.bat"
goto aftervcvars

:programfilesx86
call "C:\Program Files (x86)\Microsoft Visual Studio\2022\Professional\VC\Auxiliary\Build\vcvars64.bat"

:aftervcvars
cd %PREVDIR%
echo.

echo Your %%include%% is:
echo %include%
echo.
pause
cls
echo #
echo #  SoftechSoftware_Demo 64 bit
echo #
TITLE SoftechSoftware_Demo 64 bit
msbuild /m /p:Configuration=Release;Platform=x64 /T:rebuild GenericBkMFC.sln
REM devenv "GenericBkMFC.sln" /Rebuild "Release|x64"
if errorlevel == 255 goto failed
if errorlevel == 4 goto failed
if errorlevel == 2 goto failed
if errorlevel == 1 goto failed

msbuild /m /p:Configuration=Debug;Platform=x64 /T:rebuild GenericBkMFC.sln
REM devenv "GenericBkMFC.sln" /Rebuild "Debug|x64"
if errorlevel == 255 goto failed
if errorlevel == 4 goto failed
if errorlevel == 2 goto failed
if errorlevel == 1 goto failed

msbuild /m /p:Configuration="Release NO Unicode";Platform=x64 /T:rebuild GenericBkMFC.sln
REM devenv "GenericBkMFC.sln" /Rebuild "Release NO Unicode|x64"
if errorlevel == 255 goto failed
if errorlevel == 4 goto failed
if errorlevel == 2 goto failed
if errorlevel == 1 goto failed

msbuild /m /p:Configuration="Debug NO Unicode";Platform=x64 /T:rebuild GenericBkMFC.sln
REM devenv "GenericBkMFC.sln" /Rebuild "Debug NO Unicode|x64"
if errorlevel == 255 goto failed
if errorlevel == 4 goto failed
if errorlevel == 2 goto failed
if errorlevel == 1 goto failed

del *.aps
del *.ncb
del *.user
del *.sdf
del /AH *.suo
del Bin64\*.ilk
del Bin64\*.exp
del Bin64\*.pdb
del Bin64\*.ipdb
del Bin64\*.iobj
rmdir /S /Q IntermediateFiles64
rmdir /S /Q ipch
rmdir /S /Q .vs

goto success

:failed
echo #
echo #  Failed!!!!!
echo #
pause

:success