I switch from mac to windows a lot. As such, I often find myself typing ls, instead of dir in a windows command shell (we’ll get onto the copy paste issue another time) and it gets really really annoying.

However, you can set up aliases in windows, much the same as you would on os x/ix systems:

doskey ls=dir $

This creates an alias of ls, equivalent to dir

You can set up other commands too, but of course, you want to run them each time you open a new command window. Do the following:

  • Create a batch file with the commands you want to run each time you start a command window
  • Save file in a sensible location
  • Change the following registry key to point to your file:
    HKEY_LOCAL_MACHINE\SOFTWARE\MICROSFOT\COMMAND PROCESSOR\AutoRun

Now that bactch file will run everytime.

Word of warning!! Don’t use cd to change dir in the autorun, as it will stop all manner of scripts, which launch their own command processes (such as rails script/server) from working correctly.