Nick Karnik
Nick Karnik

Computer Scientist | Hacker | Entrepreneur | Ex-Microsoft | YC



Creating aliases in DOS

A quick walkthrough to persisting aliases in DOS

Nick KarnikNick Karnik
  1. You can create aliases in the Command Prompt by typing doskey {ALIAS}={VALUE}

    doskey d=dir
  2. Launch notepad and type some aliases

     doskey cd=cd /D $1
     doskey d=dir
     doskey mv=move
     doskey rm=del
    Note that $1 represents an argument. You can specify arguments from $1 to $9. For more info, check out the doskey documentation.
  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 the following to the existing value

    /K C:aliases.bat 

    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

    (Eg: d for dir)
To accomplish the same functionality in a DOS window during boot time, modify the autoexec.bat file.