DOSKEY macros don’t work in a batch script. However, we can use a little workaround.
set DOSKEYMacro=echo Hello World %DOSKEYMacro%
This script can simulate the macro function. One can also use ampersands(
&) to join commands, like
if you want to reproduce, please indicate the source:
batch-file – Batch file macros – Macros In Batch Script - CodeDay