batch-file Batch file macros $ Character Usages

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

Example

There are 3 usages of the $ character in a DOSKEY macro.


Command separator

$T is the equivalent of & in a batch script. One can join commands together like so.

DOSKEY test=echo hello $T echo world

Command-line arguments

Like bash(not batch), we use $ to indicate command-line argument.

$1 refers to the first command-line argument

$2 refers to second command-line argument, etc..

$* refers to all command-line argument



Got any batch-file Question?