@echo off REM ============================================================================= REM ROA Oracle Setup Script Runner REM ============================================================================= REM This wrapper runs PowerShell scripts with ExecutionPolicy Bypass REM Usage: Run.cmd [arguments] REM Example: Run.cmd 01-setup-database.ps1 REM Run.cmd 07-verify-installation.ps1 -Detailed REM ============================================================================= setlocal enabledelayedexpansion if "%~1"=="" ( echo. echo ROA Oracle Setup Script Runner echo ============================== echo. echo Usage: Run.cmd ^ [arguments] echo. echo Available scripts: echo 01-setup-database.ps1 - Initial database setup echo 02-create-sys-objects.ps1 - Create SYS objects echo 03-import-contafin.ps1 - Import CONTAFIN_ORACLE schema echo 04-create-synonyms-grants.ps1 - Create public synonyms and grants echo 05-import-companies.ps1 - Batch import company schemas echo 06-add-company.ps1 - Add new company echo 07-verify-installation.ps1 - Verify installation echo 99-uninstall-roa.ps1 - Uninstall ROA ^(cleanup^) echo. echo Examples: echo Run.cmd 01-setup-database.ps1 echo Run.cmd 07-verify-installation.ps1 -Detailed echo Run.cmd 99-uninstall-roa.ps1 -Force echo. exit /b 1 ) set SCRIPT=%~1 shift REM Build arguments string set ARGS= :argloop if "%~1"=="" goto endargs set ARGS=%ARGS% %1 shift goto argloop :endargs REM Check if script exists in scripts folder set SCRIPT_PATH=%~dp0scripts\%SCRIPT% if not exist "%SCRIPT_PATH%" ( REM Try in current directory set SCRIPT_PATH=%~dp0%SCRIPT% ) if not exist "%SCRIPT_PATH%" ( echo ERROR: Script not found: %SCRIPT% echo Looked in: echo - %~dp0scripts\%SCRIPT% echo - %~dp0%SCRIPT% exit /b 1 ) echo. echo Running: %SCRIPT% %ARGS% echo ============================================================ echo. powershell.exe -ExecutionPolicy Bypass -NoProfile -File "%SCRIPT_PATH%" %ARGS% set EXITCODE=%ERRORLEVEL% echo. echo ============================================================ if %EXITCODE% EQU 0 ( echo Script completed successfully. ) else ( echo Script failed with exit code: %EXITCODE% ) echo. exit /b %EXITCODE%