doskey ls=ls --color $*
doskey is built-in, even!
I have a startup .bat file that acts as sort-of a .bashrc
, and throw all my aliases in there, as well as having a small Python script to manage them more easily. cmd is really very bearable with a few additional tools (Cygwin goes a long way, just add its \bin
to your PATH)
To apply aliases automatically with each new instance of cmd
, create a .bat
file, for example at %USERPROFILE%\aliases.bat
with this content:
@ECHO OFF
doskey ls=ls --color $*
Then, using regedit
, locate HKEY_CURRENT_USER\Software\Microsoft\Command Processor\
and add a String Value
named Autorun
, with Value data set to: %USERPROFILE%\aliases.bat
This may be of some relevance http://stackoverflow.com/questions/946546/how-to-load-ansi-escape-codes-or-get-coloured-file-listing-in-winxp-cmd-shell
– Rook – 2009-10-14T16:52:24.840