- Aliases allow you to create custom shortcuts for long or routine commands in CMD, PowerShell, and other environments.
- On Windows, temporary aliases can be defined using doskey in CMD or permanently by editing the PowerShell profile.
- Customizing aliases and functions simplifies tasks, speeds up work, and improves the Windows Terminal experience.
Use a alias of a Command in CMD It's one of those smart strategies that can greatly facilitate and even speed up the work of any Windows user. Although many associate the concept of aliases with systems like Linux or macOS, the truth is that Windows, from its oldest versions to the newest ones with PowerShell, allows you to create custom shortcuts for the most commonly used commands.
Stop typing long paths or complicated commands and replace them with simple ones keywords Save time and reduce errors, thus improving the daily terminal experience. Let's see how:
What is an alias in CMD or Windows console?
Un alias in the Windows console is essentially a short or custom name that represents a longer or more complex command (or even a sequence of commands). With an alias you can perform common actions simply by typing an abbreviation instead of the full command.
For example, imagine you frequently navigate to a folder with an endless path several times a day. You can create an alias called "test" so that when you type it, the console automatically executes cd \a_very_long_path\test. This not only saves time, it also minimizes typing errors. and allows you to standardize repetitive tasks.
In Windows, managing aliases of a command in CMD is mainly done through the command doskey.exe, while in PowerShell functions such as Set-Alias o New-Alias, and it is possible to make them persistent by editing profile files.

How aliases work in CMD: the Doskey utility
Before learning how to create an alias for a command in CMD, it must be explained that Windows uses an internal utility called doskey.exeIts function is none other than to create and manage aliases, also known as macros. Doskey allows you to define shortcuts that automatically expand short strings into complete commands when invoked in the console.
This is an example of how to create a simple alias in CMD:
doskey test=cd \XXXXXXXXXXXXXXXXXX\test
With this, it will be enough to type "test" + Enter so that the command XXXXXXX (however long it may be) is executed automatically. It is an ideal method for long routes or repetitive actions., difficult to remember or type every time.
It is important to note the following: aliases created with doskey are only kept as long as the console window remains open. If you close the CMD session, the aliases disappear and you will have to recreate them next time.
Alias persistence in CMD and main limitations
While doskey is a great resource for creating an alias for a command in CMD, it has one drawback: aliases are not permanent. Every time you start a new console window, you'll need to define them again. To resolve this, there are several options:
- Create a batch script (.bat) or .cmd file with all your alias definitions and run it automatically when you open the console (for example, by adding it to your CMD shortcut or via the Windows Registry). This way, your aliases are loaded at the start of each session.
- Use automation tools or launchers that run doskey with your favorite macros every time you open CMD.
Another limitation is that Aliases are not shared between different console windows: Each instance of CMD maintains its own set of aliases, which are not visible to other windows open at the same time, nor to other programs that launch new cmd.exe processes.
It is also important to note that Doskey aliases only work in CMD consoles. They will not be recognized in PowerShell or other terminals.
Managing, viewing, and deleting aliases
On any terminal-based system, it is useful to know What aliases you have active and how you can delete themTo see all your aliases in CMD, there is no direct command, but you can list the aliases loaded in the current session if you have defined them via scripts or your startup file. In PowerShell, use the command Get-Alias to view a list of all defined aliases, both default and custom. To delete an alias, use Remove-Alias nombre_del_alias.
En bash (both on Linux and Git Bash for Windows), you can list your aliases with the command alias and delete one with unalias nombre_del_aliasDon't forget to edit your profile or configuration file if you want to permanently delete an alias.

Aliases in specific environments: Visual Studio and BricsCAD
Apart from the traditional console, some development environments such as Visual Studio or specific applications such as BricsCAD They also allow you to define your own aliases to customize shortcuts and commands.
En Visual Studio, aliases make it easier quickly access frequently used functionsFor example, you can use aliases to print, switch between windows, format code, run debugging, close files, and more. Aliases are typically associated with short strings that execute long commands in the Visual Studio command window.
BricsCAD allows you to define aliases in the file default.pgp, where you can modify or add new shortcuts by editing the file with a text editor. The basic structure is: alias, *command. After saving your changes, you can reload the file so the updated aliases are immediately available. This increases productivity in CAD applications through shortcuts and customized commands.
Recommendations and best practices for using aliases
Finally, here are some tips for creating a command alias in CMD:
- Choose short and meaningful names for your aliases, avoiding overwriting system aliases or native commands.
- Save all your permanent aliases in the corresponding configuration files (.bashrc, PowerShell profile, CMD startup scripts, etc.).
- Review and update your aliases periodically to ensure that they remain useful and do not cause conflict.
- If you share scripts or environments with other users, document your aliases or group the most important ones into shared files.
Aliases are one of those little gems of terminal work that, when used well, can Transform your daily routine, making it much more efficient and personalized.Explore, experiment, and fine-tune your aliases to feel truly comfortable working on any Windows console or even other platforms.
Editor specialized in technology and internet issues with more than ten years of experience in different digital media. I have worked as an editor and content creator for e-commerce, communication, online marketing and advertising companies. I have also written on economics, finance and other sectors websites. My work is also my passion. Now, through my articles in Tecnobits, I try to explore all the news and new opportunities that the world of technology offers us every day to improve our lives.