@echo off
@cd/d %~dp0
@for /f "tokens=2* delims= " %%i in ('reg query "HKLM\SOFTWARE\WOW6432Node\Embarcadero\BDS\23.0" /v RootDir') DO @set BDSPath=%%j

if not defined BDSPath goto noargs

if exist *.doc del /f /s /q *.dcu
"%BDSPath%bin\dcc64.exe" -Q -B -U..\..\..\Lib PageOperations.dpr
goto done

:noargs
echo Cannot find Delphi 12 installation path
echo Please make sure Delphi 12 is installed

:done
timeout /t 5