21
14
I am looking for a way to execute some console commands automatically when a command-prompt is opened in Windows, specifically to set some command aliases.
For example, when a command-prompt is opened, I want a command such as the following to be automatically run so that I can use ls
instead of dir
.
doskey ls=dir
How can this be done?
possible duplicate of Automatically run a script when I log on to Windows
– slhck – 2011-06-25T20:20:59.7733Windows XP does not have DOS. – user1686 – 2011-06-25T21:47:21.220
@KContreau, interessant. So it would be the reason to my batches does not save doskey subsitutions after a "start /separate" command, but only with "cmd /k" or "cmd /c"... – kokbira – 2011-06-26T00:04:24.043
do we have to change question title or not after "Clarification" edition? – kokbira – 2011-06-26T01:02:07.223
1@KCotreau: Technically, it's part of Win32 Console subsystem, not specific to
cmd.exe
. – user1686 – 2011-06-26T22:14:44.767@KCotreau, > Also, doskey in Windows did not do aliases Huh? It works for me. I open a command-prompt, typed
doskey bbdd=dir c:\/p
, then usedbbdd
and it executeddir c:\/p
as expected. Its aliasing functionality is intact. – Synetech – 2011-06-26T23:24:25.340@Synetech inc. Thank you. My memory and research failed me. Wait until you get to be my age, you will understand. :) In my defense, again, that was not part of the original question. – KCotreau – 2011-06-26T23:29:35.237
No problem; I miss DOS—though in your (re, um, attack?
:-D
), you said that after Daniel added the doskey command to the question. Anyway, I think this is what Daniel is asking about; too badAUTOEXEC.NT
won’t work forCMD.EXE
. – Synetech – 2011-06-26T23:33:21.960You might be interested in UnixUtils... http://unxutils.sourceforge.net/
– Joe Internet – 2011-06-26T23:59:00.863