Wednesday, January 9, 2013

Windows command line aliases

As a former part time Ubuntu user I used a lot of alias definitions for often used shell commands. I missed the alias utility on windows but found that the windows doskey utility is a fair enough alternative for me.

I most often use doskey in the form

doskey <MacroName>=[<Text>]
"Creates a macro that carries out the commands specified by Text. MacroName specifies the name you want to assign to the macro. Text specifies the commands you want to record." (from Windows doskey reference as linked above)
The [<Text>] parameter supports some useful special characters like

$T     separates commands
$1-$9  batch parameter placeholder

I put all my doskey definitions in a batch file (myCmd.bat) which I use to start a new command line window.

This works pretty well for me - and maybe also for you. You will find a myCmd.bat example shown below.