I use Console 2 and I would like to create some aliases for commands I use often. Maybe my google-fu just sucks today but I cannot figure out how to do this. Any help would be appreciated thanks.
Console2 is only a wrapper around hidden Win32 console windows and does not provide extended line editing functionality.
You can create aliases in Win32 consoles:
doskey d=dir $*
sh, you have to explicitly specify
$* to append given arguments (ex.
d C:\). You can also use
$T to separate commands.
Also unlike Unix, aliases are implemented at Win32 console level, not in Console2 or the cmd.exe shell. This also means that you can use them in any program that reads interactive input. (For example,
doskey /exename=python.exe h=help($*) would translate
h sys to
To load the aliases automatically for cmd.exe (Command Prompt):
create a batch script (for example,
%APPDATA%\autorun.cmd) with the
@doskey d=dir $*
Example to read multiple aliases from a file:
AutoRunto the path of your "autorun" script:
C:\> reg add "HKCU\SOFTWARE\Microsoft\Command Processor" /v AutoRun /t REG_SZ /d "%APPDATA%\autorun.cmd"
Although this question is over a year old and already answered, the following solution is simpler and avoids editing the registry:
In Console2, go to Edit > Settings. Change the "Shell:" field to the following:
C:\Windows\system32\cmd.exe /K "C:\Path\to\aliases.cmd"
Now restart Console2 and you're done.
To possibly save you some time, here's a simple example of an aliases.cmd file:
@echo off DOSKEY clear=cls DOSKEY ls=dir DOSKEY ex=explorer . DOSKEY ll=dir /A DOSKEY rm=del $*