%PBAT_VERSION%, %PBAT_OS%, %PBAT_OS_TYPE%, %PBAT_PATH%, %PBAT_SHARE%, %PBAT_ETC%, %PBAT_IS_SCRIPT% variables

The %PBAT_VERSION% variable expands to the current version of pBat.

The %PBAT_OS% variable expands to the name of the current OS running pBat.

The %PBAT_OS_TYPE% variable expands to the type of the current OS running pBat.

The %PBAT_PATH% variables expands to the path to pBat directory.

The %PBAT_IS_SCRIPT% variable is used to detect whether the execution flow comes from a script or from the prompt.

%PBAT_SHARE% and %PBAT_ETC% expands to the locations of various pBat files.

Synopsis

%PBAT_VER%

Contain pBat version number.

%PBAT_OS%

Contains the OS name on which pBat is runnig. This variable does not give any information on OS version though. The possible value are:

This variable is interesting to execute specific code for any of these platforms. In most cases, the variable %PBAT_OS_TYPE% is sufficient.

%PBAT_PATH%

%PBAT_PATH% contains the path to the pBat executable. This path is dinamically generated, so that the path will be correct even from non conventionnal paths, this enables making portable version on removable media.

%PBAT_OS_TYPE%

Contains the type of operating system on which pBat is running. It can have two values:

Expands to false if pBat has been launched in interactive mode (that is, with no script to execute) or true else. This value is useful inside configuration scripts such as pBat_Auto.bat. The value of %PBAT_IS_SCRIPT% is inherited when a script is CALLed, however, the value is overwritten in any other case.

%PBAT_SHARE%

Contains the path to the folder where pBat static data is stored.

%PBAT_ETC%

Contains the path to the folder where pBat configuration files are stored.

Compatibility

Uncompatible with cmd.exe, these variable are not defined.

Availiable since version 0.7.

See also

Environment variables, Specifications index