Command Prompt for Windows

Command MACRO


Provides command line macros.


MACRO [macroname=text]
MACRO [/D macroname]
macronameSpecifies the name of the new command.
textSpecifies the commands to be executed.
/DDelete a macro.
ONDisplay expanded macros.
OFFDo not display expanded macros.
The are some special character combinations that have a special meaning and that can be included in parameter text :-

$$Dollar sign.
$1 to $9Replaceable parameters similar to the replaceable parameters %1 to %9 used in batch files.
$*Replace with the whole command tail.
$BBar character. Pipe commands.
$GGreater than sign character. Redirect output.
$LLess than sign character. Redirect input.
$TCommand separator.


Type MACRO without any parameters to display a list of all the macros defined.

Macros can have the same name as an original command, to execute the original command, type a space character before the command is entered.

Only the first 12 characters in parameter macroname are significant when executing a macro at the command prompt. However, all the characters in parameter macroname are significant when deleting a macro.

Macros are saved as they are created.

Examples on using MACRO.