Create command-line alias in windows
Many time we need to use the same commands all-time in the terminal example:
- change directory to a long path like-
2. Open your server ssh terminal every time you need to run ssh commands like —
We can set an alias to quickly execute to a particular command like-
Run: wd so it will locate to desired path
But as we close the terminal so it would not work any more. How to make it permanent.
- Create a batch file here we can write Doshkey commands
2. Copy command prompt shortcut to desktop/ any location you want -
3. Rename it to any name — alias
4. now provide a path of the batch file to this shortcut by —
a. right click on icon select properties -> shortcut
b. In target give space and add
/k C:\Users\user\Desktop\working_dir\doskey.bat
Done. Now you can easily access your all alias by opening this shortcut
like —
You can now put any number of alias in .bat file
Please give a clap if you like this post. Also, write in the comment section.