Coming from a linux shell, I'm used to being able to source a file into the current environment. How can I do this in the Windows cmd
command prompt?
e.g. in linux I can create an alias for a long complicated command:
alias shortcut="some super long command with lots of --options and arguments etc"
alias another="some other super long command with lots of --options and arguments etc"
alias again="yet another super long command with lots of --options and arguments etc"
then I can save that to a file and just source aliases.bash
and even automatically load it when starting the shell such as when used in a .bashrc
or .bash_profile
file.
I know I can do something similar at runtime in the cmd
prompt with doskey
doskey shortcut="some super long command with lots of --options and arguments etc"
But how can I save all these doskey
entries into a master file that I can load into the current environment? Even better, how can I load them automatically when starting the cmd
prompt?