BATCH_DEBUGGING is an environment variable that is created once you start debugging a batch file.
It is equal to 1 when debugging a batch file.
It exists only when debugging a batch file.
_BDEBUGGER is an internal variable that is equal to 1 when debugging a batch file.
It is equal to 0 otherwise.
Example:
Code:
@setlocal
@echo off
if defined BATCH_DEBUGGING echo BATCH_DEBUGGING exists in the environment.
if %BATCH_DEBUGGING eq 1 echo BATCH_DEBUGGING equals 1. You are debugging a batch file.
if %_BDEBUGGER eq 1 echo _BDEBUGGER equals %_BDEBUGGER. You are debugging a batch file.
endlocal
quit
Of course, if you create these yourself, and define these with different values, you get different results;
Code:
@setlocal
@echo off
set BATCH_DEBUGGING=abc
if defined BATCH_DEBUGGING echo BATCH_DEBUGGING exists in the environment.
if %BATCH_DEBUGGING eq 1 echo BATCH_DEBUGGING equals 1. You are debugging a batch file.
set _BDEBUGGER=9
if %_BDEBUGGER eq 1 echo _BDEBUGGER equals %_BDEBUGGER. You are debugging a batch file.
endlocal
quit
Thus, best never to over-ride BATCH_DEBUGGING and/or _BDEBUGGER in your .BTM files.
Joe