Problem:
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.
Solution:
- You can create aliases in the Command Prompt by typing doskey {ALIAS}={VALUE}
[For Example: doskey d=dir]
- 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 - Save the file as C:\aliases.bat
- Create a shortcut on your desktop to cmd.exe (found in the system32 directory)
- Go to the Shortcut Properties -> Shortcut tab -> Target section
- Append /K C:\aliases.bat to the existing value
- Click OK to save the changes
- Double click the shortcut on the desktop and launch a new command window
- 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.



