As Christian.K said in his comment, the DOSKEY command can be used to define macros, which are analogous to aliases.
Macro parameters are referenced in the definition via
$ prefixed positions:
$* for all.
See the doskey technet documentation, or type
doskey /? or
help doskey from the command line for more information.
But there are serious limitations with DOSKEY macros:
- The macros only work on the interactive command line - they do not work within a batch script.
- They cannot be used on either side of a pipe: Both
someMacro|findstr '^' and
- They cannot be used within a FOR /F commands:
for /f %A in ('someMacro') do ... fails
The limitations are so severe that I rarely use DOSKEY macros.
Obviously you can create batch scripts instead of macros, and make sure the script locations are in your PATH. But then you must prefix each script with CALL if you want to use the script within another script.
You could create simple variable "macros" for long and oft used commands, but syntax is a bit awkward to type, since you need to expand the "macro" when you want to use it.
set "cdMe=cd a_very_long_path"
Usage (from command line or script)