Using doskey to setup alias

This is obviously old, but still useful nonetheless. I’m using it as an alternative to adding a directory to PATH, but there are many more use-cases. The 2 steps below will store the aliases (“macros”, in windows speak) in a file and setup the command prompt to load them every time it is started.

Put the aliases in %userprofile%\mymacros.txt:
VBoxManage="c:\Program Files\Oracle\VirtualBox\VBoxManage.exe" $*

In HKEY_CURRENT_USER\SOFTWARE\Microsoft\Command Processor, create/edit a string value “AutoRun”:
doskey /macrofile="%userprofile%\mymacros.txt"

The aliases (macros…) should be ready the next time the command prompt is started.

Doskey reference


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s