You are not logged in.
Hi
What I am after is a way to create short codes for commands.
For example on my mac I use aliases for git command.
alias gs="git status;"
So when I run 'gs' it is actually running 'git status;'.
Is there a way to do this on windows?
Thanks
Offline
There are a few ways you could approach this, I would recommend an individual script directory method.
1. Create a folder
2. Add that folder to the PATH
3. Create BAT or CMD scripts with the name of the file being the alias you want and the content of the script to be the command you want the alias to execute.
gs.bat
@git status %*
The percent asterisk passes all parameters to the script to the command and the at symbol hides the nested command from the console.
I also like this method because you can use the where command to find the alias file if you forget.
Offline
Offline
@Simon I don't think the Save and restore macro definitions method on https://ss64.com/nt/doskey.html will work as intended.
Rather than outputting to a .cmd file to run, you'd need to do:
doskey /macros > macros.txt
doskey /macrofile=macros.txt
Last edited by bluesxman (16 Feb 2017 16:32)
cmd | *sh | ruby | chef
Offline