Previous Topic: Pattern-Based Audit Test ParametersNext Topic: Using Special XML Characters in Batch Files


Using Variables in Batch Processing

While using CA GovernanceMinder in production and using batch processing, you may need to specify dynamic parameters for filenames that are defined in the SBT files.

For example, instead of writing CONFIG="AD_Config.cfg", you may prefer that the filename has the date and time. If so, you can specify the current date and time in the filename as a variable. Each time you run the batch file the filename automatically updates with the current date and time.

Example:

<BATCH>
<COMMAND
ACTION="IMPORT CSV"
ROLEID_AS_NUM="true"
CONFIG="Config_%%DATE%%_%%TIME%%_%%USERNAME%%.cfg"
USERS_DB="UsersDB.udb"
RES_DB="ResDB.rdb"
ROLE="roles.txt"
USER_RES="user-res.txt"
USER_ROLE="user_role.txt"
ROLE_RES="role_res.txt"
ROLE_ROLE="role_role.txt"/>
</BATCH>

Filename variables in SBT files are converted when the SBT file is executed.

A variable is defined as a keyword surrounded by %% and %%, such as %%DATE%%.

The following table lists all supported variables in CA GovernanceMinder:

Variable Name

Output format

Any user environment variable

The parameter's value

Example:

If HOME= C:\HOME

%%HOME%% will be replaced with C:\HOME

%%DATE%%

YYYYMMDD

%%TIME%%

HHMM