batch-file Batch file macros Macros In Batch Script

30% OFF - 9th Anniversary discount on Entity Framework Extensions until December 15 with code: ZZZANNIVERSARY9

Example

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 $T in DOSKEY.

If you want a relatively large "macro", you may try a simple function or take a look at other function topics here.



Got any batch-file Question?