Creating aliases in DOS/Command Prompt


One of the features I wish for in the Command Prompt launched in Windows is the ability to create aliases. However, there is a way to accomplish the same.


  1. You can create aliases in the Command Prompt by typing doskey {ALIAS}={VALUE}
    [For Example: doskey d=dir]
  2. Launch notepad and type some aliases. Note that $1 represents an argument. You can specify arguments from $1 to $9. For more info, check out the doskey documentation.
    doskey cd=cd /D $1
    doskey d=dir
    doskey mv=move
    doskey rm=del

  3. Save the file as C:\aliases.bat

  4. Create a shortcut on your desktop to cmd.exe (found in the system32 directory)

  5. Go to the Shortcut Properties -> Shortcut tab -> Target section
  6. Append /K C:\aliases.bat to the existing value

    Properties window for Shortcut to Command Prompt

    Properties window for Shortcut to Command Prompt

  7. Click OK to save the changes
  8. Double click the shortcut on the desktop and launch a new command window
  9. Try out some of your aliases (Example: d for dir)
Note: To accomplish the same functionality in a DOS window during boot time, modify the autoexec.bat file.