Please enable JavaScript to view this site.

Bug Validator Help

Navigation: Command Line Interface

Environment variables

Scroll Prev Top Next More

Environment variables can be referenced on the command line.


This allows you to set an environment variable outside of Bug Validator (cmd prompt, batch file, etc) and then reference it on the command line.


For example:


 -program %BUILD_DIR%\testProgram.exe


 If the BUILD_DIR environment variable is set to e:\dev\debug the above would evaluate to -program e:\dev\debug\testProgram.exe



What if I can't set an environment variable?


There are situations where it isn't desirable, or possible to set the environment variable value prior to starting Bug Validator.


In those situations you can set the environment variable on the command line using -setenvironment.


 -setenvironment BUILD_DIR=e:\dev\debug -program %BUILD_DIR%\testProgram.exe



Problems with environment variable substitution


If you are running from a command prompt, or batch file, or any process that will handle environment variable substitution using %ENV_VAR% you will find that referencing the environment variable on the command line won't work when using -setenvironment, because by the time Bug Validator sees the command line the %ENV_VAR% values have already been substituted.


To get around this, using $ENV_VAR$ instead of %ENV_VAR%.


-setenvironment BUILD_DIR=e:\dev\debug -program $BUILD_DIR$\testProgram.exe





Set environment variables for Bug Validator, as a series of name/value pairs.


Use this option once for each environment variable you wish to set.


Usage of -setenvironment for any environment variable must appear on the command line prior to any reference to that environment variable on the command line.


note To pass quotes along with the string, escape a pair of inner quotes like the example below




-setenvironment APP_FLAG=ON;

-setenvironment "APP_FAG=ON;"

-setenvironment "APP_COMMS=ON; APP_DEBUG=OFF;"
-setenvironment "APP_MSG=\"A quoted string with spaces\";"

 -setenvironment BUILD_DIR=e:\dev\debug



Note that this is not the same as -environment, which allows you to specify environment values that you can pass to the program being launched.