Appearance
BBRun.exe Runtime Guide
BBRun.exe is the BTB runtime engine. It is the self-contained executable that runs scripts, executes compiled script files, and builds self-executable applications from .bbs sources.
This is an advanced topic intended for users who need to distribute BTB solutions, protect source code, or package scripts for unattended use.
1. What BBRun.exe Does
You can use BBRun.exe to:
- Run a
.bbsscript file - Run a compiled
.bbcfile - Compile a
.bbsscript into.bbc - Create a standalone
.exefrom a script
2. Running a Script
Pass the script file name or compiled file name to BBRun.exe.
text
BBRun.exe <script file name>
BBRun.exe <compiled file name>Examples:
text
BBRun.exe ".\temp\Hello.bbs"
BBRun.exe ".\temp\Hello.bbc"Use this mode when you want to execute a script directly from the BTB runtime without creating a standalone executable.
3. Compiling a Script
To protect source code before distribution, compile a .bbs script into a .bbc file.
text
BBRun.exe -c "myscript.bbs"The resulting compiled file can then be distributed and run through BBRun.exe.
4. Creating a Self-Executable
You can compile a script and package it into a standalone executable in one step.
text
BBRun.exe -e "myscript.bbs" ["exe filename"]If the output file name is omitted, BTB uses the script name and produces myscript.exe.
Use this mode when you want to ship a single executable instead of requiring users to run the script through the runtime manually.
5. Runtime Directives for Self-Executable Builds
When building an .exe, BBRun.exe can read startup options from comment lines placed at the top of the script.
Example:
text
'TITLE=My Application
'HIDEAPP=0
'RESCACHE=resources
'VERBOSE=0
'DISPLAYNAME=My Application - Service
'ACCOUNTNAME=JohnDoe
'ACCOUNTPASSWORD=XXXXXX
'STARTTYPE=0
'DELAYSTART=1000
'OUTPUTLOG=.\LogResults.log
'ERRORLOG=.\ErrorLog.logThese directives allow the packaged executable to control startup behavior, logging, service settings, and resource extraction behavior.
6. Service-Related Directives
These directives are commonly used when a packaged BTB application is intended to run as a Windows service or background automation job.
DISPLAYNAME
text
'DISPLAYNAME=My Application - ServiceSpecifies the name shown in the Windows Services list.
Built-in variable: _servicename
ACCOUNTNAME
text
'ACCOUNTNAME=JohnDoeSpecifies the Windows account used to run the service.
ACCOUNTPASSWORD
text
'ACCOUNTPASSWORD=XXXXXXSpecifies the password for the Windows account.
Security
This value is stored in clear text in the script source. Use it carefully and avoid committing real credentials to source control.
STARTTYPE
text
'STARTTYPE=0Supported values:
0= Boot1= System2= Automatic3= Manual4= Disabled
Built-in variable: _starttype
DELAYSTART
text
'DELAYSTART=1000Delays startup by the specified number of milliseconds. The default is 0.
HIDEAPP
text
'HIDEAPP=0Controls whether the application UI or tray icon is shown on startup.
0= Show the tray icon so the user can interact with or cancel the process1= Hide the tray icon and prevent normal tray-based cancellation
TITLE
text
'TITLE=My ApplicationSets the application title shown to the user. If omitted, the script name is typically used.
VERBOSE
text
'VERBOSE=0Controls the runtime notification and logging mode.
0= Normal application execution1= Invisible or service-style execution using an output log file2= Service-oriented logging through the Windows Event Log
Built-in variable: _verbose
OUTPUTLOG
text
'OUTPUTLOG=.\LogResults.logSpecifies the output log file. This is mainly useful when VERBOSE=1.
Built-in variable: _outputlog
ERRORLOG
text
'ERRORLOG=.\ErrorLog.logSpecifies the error log file used for runtime failures.
Built-in variable: _errorlog
7. Attaching Resources to a Self-Executable
BTB can package additional files into the generated executable.
Create an .ssr file with the same base name and location as the .bbs script. Put one file path on each line.
Example:
If your script is MyApplication.bbs, create MyApplication.ssr.
text
.\banner.jpg
.\data\data.txt
c:\temp\page.pdfWhen the executable runs, BTB extracts these files so the packaged application can use them.
8. Resource Caching
By default, extracted resources are placed in a temporary folder and removed when the application exits.
If you want the resources to remain available after execution, set RESCACHE to a folder name:
text
'RESCACHE=myresourcesThis tells BTB to extract resources into a persistent folder under the user's profile instead of a temporary location.
Use this only when you intentionally want extracted files to remain on disk. BTB does not automatically remove that cached folder later.
9. When to Use BBRun.exe
Use the runtime directly when you need:
- Source protection through
.bbccompilation - Standalone
.exedelivery - Attached payload files
- Windows service packaging
- Advanced deployment and startup control
For general language syntax and script authoring, start with the User Manual and Command Reference.