I’m sure we all recall how to create aliases in any Cisco CLI to save time with the most frequent commands. Well, today we hit Windows CMD.

Key here is doskey command. What in Cisco world is called alias, here with Redmond OS we call them macros.

Help output for doskey:

Doskey

Some examples:

Clear screen:

doskey l=cls

Show routing table:

doskey sir=route print

Show TCP/IP config:

doskey sip=ipconfig /all

We can also use variables, as shown in the command help. An equivalent to GNU’s grep:

doskey g=findstr /i "$1"

Add a static route:

doskey ir=route add -p "$1" mask "$2" "$3"

And so on.