By using ECHO and PAUSE commands it could be possible to add a debugging mode.
These tricks can be useful to create a debugging mode, too.
@ECHO OFF
;= REM Call DOSKEY and use this file as the macrofile
;= %SystemRoot%\system32\DOSKEY /LISTSIZE=1000 /MACROFILE=%0%
;= REM In batch mode jump to the end of the file
;= GOTO END
;= a comment here
ALIAS=DOSKEY $*
;= REM This is the GOTO endpoint
;= :END
;= Do not remove the following empty line, it clears the ';' macro
;=
It abuses the fact that the command prompt in Windows will silently skip the ';=' prefix, while DOSKEY will treat it as a macro being re-defined over and over again.