Menu

#5 Add dubug code

open
nobody
code (4)
enhancement
Irrelevant
low
2025-04-10
2014-11-15
Zangune
No

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.

Discussion

  • Zangune

    Zangune - 2025-04-09
    • labels: --> code
     
  • Zangune

    Zangune - 2025-04-10
    • assigned_to: Zangune --> nobody
     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB