Skip to content

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 .bbs script file
  • Run a compiled .bbc file
  • Compile a .bbs script into .bbc
  • Create a standalone .exe from 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.log

These directives allow the packaged executable to control startup behavior, logging, service settings, and resource extraction behavior.


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 - Service

Specifies the name shown in the Windows Services list.

Built-in variable: _servicename

ACCOUNTNAME

text
'ACCOUNTNAME=JohnDoe

Specifies the Windows account used to run the service.

ACCOUNTPASSWORD

text
'ACCOUNTPASSWORD=XXXXXX

Specifies 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=0

Supported values:

  • 0 = Boot
  • 1 = System
  • 2 = Automatic
  • 3 = Manual
  • 4 = Disabled

Built-in variable: _starttype

DELAYSTART

text
'DELAYSTART=1000

Delays startup by the specified number of milliseconds. The default is 0.

HIDEAPP

text
'HIDEAPP=0

Controls 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 process
  • 1 = Hide the tray icon and prevent normal tray-based cancellation

TITLE

text
'TITLE=My Application

Sets the application title shown to the user. If omitted, the script name is typically used.

VERBOSE

text
'VERBOSE=0

Controls the runtime notification and logging mode.

  • 0 = Normal application execution
  • 1 = Invisible or service-style execution using an output log file
  • 2 = Service-oriented logging through the Windows Event Log

Built-in variable: _verbose

OUTPUTLOG

text
'OUTPUTLOG=.\LogResults.log

Specifies the output log file. This is mainly useful when VERBOSE=1.

Built-in variable: _outputlog

ERRORLOG

text
'ERRORLOG=.\ErrorLog.log

Specifies 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.pdf

When 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=myresources

This 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 .bbc compilation
  • Standalone .exe delivery
  • 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.

Chalard Tools documentation suite