Aliases in CMD.exe

Turns out that Microsoft’s doskey command can actually create aliases that work in a command prompt (cmd.exe). Microsoft calls these things “macros”. Here’s my current list:

C:\>doskey /macros
measure=start /B /WAIT /HIGH /AFFINITY 1 ntimer.exe $*
sad=jvf -r -mmaster.amd64 -ddiffs.amd64
view=vim -R $*
vimrc=vim %ESSENTIALS%\vim\_vimrc
spec=cd G:\cpu2000
p2=nenscript -2GNr -TUS $*
p1=nenscript -GNr -TUS $*
svn=svn --config-dir %ESSENTIALS%\subversion\config $*
vsdbg=devenv /debugexe $*
cmd=start %ComSpec% /K %ESSENTIALS%\setenv.cmd
vc32=vc80env.cmd x86
vc64=vc80env.cmd amd64
ss=sd sync * && for /D %D in (*.*) do start sd sync %D\...
wl=less -S -# 2 $*
dis=link /dump /disasm $1 | less -S -#3
which=where $*
vf=jvf $*
vi=vim $*
ll=ls -l $*

One of my personal favorites is “ap”, which adds the current directory to your path.

Update: Kevin found a bad-ass application for this.


2 Responses to “Aliases in CMD.exe”

  1. 1 Kevin Frei September 28, 2005 at 10:20 am

    DosKey macros are pure evil – use scripts for anything that doesn’t override an internal cmd command.

  2. 2 Mark October 4, 2005 at 8:23 pm

    I’m not sure they are _pure_ evil. Maybe just 99.44% 🙂

    As you say, there is no other way to override an internal cmd command.

    I realize it’s just my unix heritage talking, but I would never write a one-line script — I’d always prefer an alias.

Comments are currently closed.

%d bloggers like this: