Make the command persistent by recording it in a .bat/.cmd file and add the path of the file to registry.
For example, your command may look like DOSKEY ls=dir DOSKEY sublime="C:\Program Files\Sublime Text 2\sublime_text" $* $* is useful for commands that take on arguments. For example, here I like to be able to do sublime my_code.c.
The registry for cmd is at HKEY_CURRENT_USER -> Software -> Microsoft -> Command Processor. Create a string valued entry called AutoRun with the full path of the file (not the containing folder) such as %USERPROFILE%\custom_command.cmd. Then each time cmd is run, your command will be loaded!
You can add more useful stuffs to the batch file too. See here for an example template.
You could:
ls.bat
and have it contain thedir
command onlyls.bat
file exists to yourPATH
environment variableYou could then execute
ls
from a command prompt.Its an old question but for the record:
http://gnuwin32.sourceforge.net/packages/coreutils.htm
Gives you ls and a whole lot more!
Easiest way I have found is:
bin
directory of Git to your Path variable. Mine was located inC:\Program Files\Git\usr\bin
.ls
in all its glory.Surely ls would not work as a unix command for the batches. If you check %1 for -l or -a etc. and all combinations of them, it would work...
you could also use cygwin and just use the ls command directly along with all the other unix command line tools you might be used to.
I recommend the following recipe.
DOSKEY
and$*
to create yourls
command.For example, your command may look like
DOSKEY ls=dir
DOSKEY sublime="C:\Program Files\Sublime Text 2\sublime_text" $*
$*
is useful for commands that take on arguments. For example, here I like to be able to dosublime my_code.c
.The registry for cmd is at HKEY_CURRENT_USER -> Software -> Microsoft -> Command Processor. Create a string valued entry called AutoRun with the full path of the file (not the containing folder) such as
%USERPROFILE%\custom_command.cmd
. Then each time cmd is run, your command will be loaded!You can add more useful stuffs to the batch file too. See here for an example template.