Saturday, 1 September 2018

windows - Command aliases in Command Prompt?


How can I make command aliases in Windows' Command Prompt like I would with bash?


I found out about doskey in a forum thread, so I can do something like:


doskey ls=dir /b

...and now the command ls acts a little more like ls on Unix. (I type ls so often in cmd, it isn't even funny.)


But how do I get this to stick between sessions? It goes away the next time I open cmd.exe. (Is there something like .bash_profile?)



Answer



cygwin can be used in this case although this is not exactly an on-topic answer.


http://www.cygwin.com/ CygWin
Download: http://cygwin.com/setup.exe


To access it easily in windows, you can put c:\cygwin\bin in your path.


note that there are a few command that clashes with windows software which is not equivalent e.g. find(1) vs find.exe -- find(1) lists all files and subdirectories whereas find.exe functions like grep.


another option is to access



HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\AutoRun or HKEY_CURRENT_USER\Software\Microsoft\Command Processor\AutoRun



check out


 cmd.exe /? 

for more details

No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...