:menu cls echo HCBB Automation Tool echo 1. Run Full Batch Process echo 2. Run Only Cleanup echo 3. Exit choice /c 123 /n /m "Select option: " if errorlevel 3 exit if errorlevel 2 goto cleanup if errorlevel 1 goto full_process Automatically create a new output folder for each day:
@echo off set HCBB=C:\HCBB\hcbb.exe set LOG=C:\HCBB\logs\nightly.log echo %date% %time% - Nightly cleanup started >> %LOG%
:: Rebuild indexes for %%t in (Sales, Inventory, Customers) do ( %HCBB% sql --query "ALTER INDEX ALL ON %%t REBUILD" --server localhost if %errorlevel% neq 0 goto error ) hcbb script auto bat
A: That depends on your HCBB version. However, the batch script itself has no file size limit—it only passes filenames. The limit is your RAM.
:: Execute HCBB command "%HCBB_PATH%" process --input "%%f" --output "%OUTPUT_DIR%" --verbose :menu cls echo HCBB Automation Tool echo 1
Start with the simple scripts provided in this guide. Test them with non-critical data. Gradually introduce loops, error handling, and scheduled tasks. Within a week, you will wonder how you ever managed HCBB without automation.
:: Report %HCBB% report --type daily --email team@company.com >> %LOG% echo %date% %time% - Completed successfully >> %LOG% exit /b 0 Exit choice /c 123 /n /m "Select option:
:: Check error level if !errorlevel! neq 0 ( echo ERROR: Failed to process %%f with code !errorlevel! >> %ERROR_LOG% ) else ( echo SUCCESS: %%f processed >> %LOG_FILE% move "%%f" "%INPUT_DIR%\Archived\" 2>nul ) )