Skip to main content

Define an Alias in Windows Command Prompt.

:: Here's how you define an alias within the current Command Prompt instance:
doskey ynftag=yarn info --verbose --no-emoji $* dist-tags

:: Since Command Prompt doesn’t come with a .bashrc equivalent, in order to persist
:: your aliases permanently, you’ll need to create a custom `cmdrc.cmd` file (could
:: be any name, but we recommend you to stick with the long-standing naming
:: convention) inside your home directory, with the following content:

@echo off
doskey ynftag=yarn info --verbose --no-emoji $* dist-tags

:: Then modify your Command Prompt shortcut target to:
:: Replace `cmdrc.cmd` with the full path that leads to the file.
cmd.exe /k cmdrc.cmd