Command aliases in Windows: Use doskey

I wanted to add some aliases to the command prompt in Windows (not Powershell)

  • Create a doskey file, this is mine.  Please note that all the non standard commands like notepad++ and devenv exe are already in my PATH environment variables
ls=dir /q $1
ip=ipconfig $*
np=notepad++
vs=devenv

Then create a registry editor command file.  I called mine commandprocessor.reg and put this in it.  C:\utilities\macros.doskey is the file and location of the above doskey file I made

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor]
"CompletionChar"=dword:00000009
"DefaultColor"=dword:00000000
"EnableExtensions"=dword:00000001
"PathCompletionChar"=dword:00000009
"Autorun"="DOSKEY /MACROFILE=\"C:\\utilities\\macros.doskey\""

Save as commandprocessor.reg or something else and double click it to run.  The next time you login or bootup and open your cmd prompt you should have access to all the aliases you defined above.