batch-file $ Character Usages


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